Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ConvertKiller

100% client-side file conversion powered by WebAssembly

Rust WebAssembly Next.js License

Fast, private, and secure file format conversion that runs entirely in your browser. No uploads, no servers, no tracking.

Live Demo | Contributing


✨ Features

  • πŸ”’ 100% Local Processing: Your files never leave your browser. Zero uploads, complete privacy.
  • ⚑ WebAssembly Performance: Native-speed conversion using Rust compiled to WASM.
  • 🎨 7 Image Formats: PNG, JPG, WEBP, BMP, GIF, ICO, TIFF
  • 🎡 6 Audio Formats: MP3, WAV, FLAC, OGG, AAC, M4A β†’ WAV output
  • πŸ”„ Batch Processing: Convert multiple files simultaneously (up to 2 concurrent jobs)
  • ♻️ Job Re-conversion: Change output format and reconvert without re-uploading
  • πŸ“Š Real-time Status: Visual feedback with animated progress indicators
  • πŸ’Ύ Smart Memory Management: Automatic cleanup of download URLs and zero-copy where possible

πŸš€ Quick Start

Prerequisites

  • Rust 1.92.0 or higher
  • Node.js 18.x or higher
  • wasm-bindgen-cli 0.2.106
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Add WASM target
rustup target add wasm32-unknown-unknown

# Install wasm-bindgen-cli
cargo install wasm-bindgen-cli --version 0.2.106

Build WASM

# Navigate to Rust workspace
cd crates

# Compile to WebAssembly (release mode)
cargo build --target wasm32-unknown-unknown --release -p wasm-bindings

# Generate JavaScript bindings
wasm-bindgen target/wasm32-unknown-unknown/release/wasm_bindings.wasm \
  --out-dir ../apps/web/public/wasm \
  --target web \
  --typescript

Run Development Server

# Navigate to Next.js app
cd apps/convert-killer

# Install dependencies
npm install

# Start dev server
npm run dev

# Open http://localhost:3000

πŸ“– Usage Example

Basic Image Conversion

import { useConversionQueue } from "@/hooks/useConversionQueue";

function MyConverter() {
  const { jobs, addFiles, updateJobFormat, startConversion } = useConversionQueue();

  return (
    <div>
      <input
        type="file"
        accept="image/*"
        onChange={(e) => addFiles(e.target.files!)}
      />
      
      {jobs.map(job => (
        <div key={job.id}>
          <span>{job.name}</span>
          <select onChange={(e) => updateJobFormat(job.id, e.target.value)}>
            <option value="PNG">PNG</option>
            <option value="JPG">JPG</option>
            <option value="WEBP">WEBP</option>
          </select>
          <span>{job.status}</span>
        </div>
      ))}
      
      <button onClick={startConversion}>Convert</button>
    </div>
  );
}

Adding a New Converter (Rust)

use converter_core::Converter;

pub struct MyConverter;

impl Converter for MyConverter {
    fn supports(&self, format: &str) -> bool {
        matches!(format.to_uppercase().as_str(), "FORMAT1" | "FORMAT2")
    }

    fn convert(&self, input: &[u8], source: &str, target: &str) -> Result<Vec<u8>, String> {
        // Your conversion logic here
        Ok(output_bytes)
    }
}

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Browser                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                  React UI Layer                      β”‚   β”‚
β”‚  β”‚  (Next.js + TypeScript)                             β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                         β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚              useConversionQueue Hook                 β”‚   β”‚
β”‚  β”‚  β€’ Manages job queue (max 2 concurrent)             β”‚   β”‚
β”‚  β”‚  β€’ Handles file reading via FileReader              β”‚   β”‚
β”‚  β”‚  β€’ ObjectURL lifecycle management                   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                         β”‚ postMessage                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚               Web Worker Thread                      β”‚   β”‚
β”‚  β”‚  β€’ Lazy loads WASM modules by category              β”‚   β”‚
β”‚  β”‚  β€’ Caches modules for reuse                         β”‚   β”‚
β”‚  β”‚  β€’ Handles job cancellation                         β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                         β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚            WebAssembly (Rust)                        β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚
β”‚  β”‚  β”‚ ImageConverter (image crate 0.25.9)           β”‚ β”‚   β”‚
β”‚  β”‚  β”‚  β€’ PNG, JPG, WEBP, BMP, GIF, ICO, TIFF       β”‚ β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚
β”‚  β”‚  β”‚ AudioConverter (symphonia + hound)            β”‚ β”‚   β”‚
β”‚  β”‚  β”‚  β€’ MP3, FLAC, OGG, AAC, M4A β†’ WAV            β”‚ β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Design Decisions

  • Trait-based architecture: Converter trait allows easy extension
  • Lazy loading: WASM modules loaded on-demand by category
  • Zero-copy optimizations: Direct references where possible (limited by Symphonia's 'static requirement)
  • Correct WAV encoding: Uses hound library for guaranteed header correctness
  • Next.js compatibility: Worker uses URL constructor for base path support

πŸ“Š Supported Formats

Images (7 formats)

Format Input Output Notes
PNG βœ… βœ… Transparency supported
JPG βœ… βœ… No transparency
WEBP βœ… βœ… Modern format
BMP βœ… βœ… Legacy format
GIF βœ… βœ… ⚠️ First frame only
ICO βœ… βœ… Windows icons
TIFF βœ… βœ… Professional format

Audio (6 β†’ 1 format)

Input Format Output Quality
MP3 WAV PCM 16-bit
FLAC WAV Lossless decode
OGG WAV Vorbis decode
AAC WAV AAC decode
M4A WAV AAC decode
WAV WAV Re-encode

Note: Audio always outputs to WAV (PCM 16-bit signed) due to patent licensing restrictions on MP3/AAC encoding.


πŸ› οΈ Development

Project Structure

converter/
β”œβ”€β”€ crates/                     # Rust workspace
β”‚   β”œβ”€β”€ core/                   # Converter trait
β”‚   β”œβ”€β”€ image/                  # Image converter
β”‚   β”œβ”€β”€ audio/                  # Audio converter
β”‚   └── wasm-bindings/          # JavaScript exports
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/                    # Next.js static files
β”‚   β”‚   └── public/wasm/        # Compiled WASM
β”‚   └── convert-killer/         # Main Next.js app
β”‚       └── src/
β”‚           β”œβ”€β”€ components/     # React components
β”‚           β”œβ”€β”€ hooks/          # React hooks
β”‚           β”œβ”€β”€ models/         # TypeScript types
β”‚           β”œβ”€β”€ workers/        # Web Workers
β”‚           └── utils/          # Utilities
└── IMPLEMENTATION_GUIDE.md     # Detailed documentation

Running Tests

# Test Rust converters
cd crates/image
cargo test

cd ../audio
cargo test

# Test TypeScript (when implemented)
cd apps/convert-killer
npm test

Building for Production

# 1. Build WASM (optimized)
cd crates
cargo build --target wasm32-unknown-unknown --release -p wasm-bindings
wasm-bindgen target/wasm32-unknown-unknown/release/wasm_bindings.wasm \
  --out-dir ../apps/web/public/wasm \
  --target web \
  --typescript

# 2. Build Next.js app
cd ../apps/convert-killer
npm run build

# 3. Deploy 'out/' directory to your static host

🀝 Contributing

We welcome contributions! Here's how you can help:

Adding New Format Support

  1. Implement the Converter trait in Rust:

    // crates/myformat/src/lib.rs
    impl Converter for MyFormatConverter {
        fn supports(&self, format: &str) -> bool { ... }
        fn convert(&self, input: &[u8], source: &str, target: &str) -> Result<Vec<u8>, String> { ... }
    }
  2. Export to WASM:

    // crates/wasm-bindings/src/lib.rs
    #[wasm_bindgen]
    pub fn convert_myformat(input: &[u8], source: &str, target: &str) -> Result<Vec<u8>, JsValue> {
        // Use your converter
    }
  3. Update Worker:

    // apps/convert-killer/src/workers/converter.worker.ts
    case "myformat":
        module = { convert: (input, source, target) => wasmModule.convert_myformat(input, source, target) };
  4. Add format detection:

    const FORMAT_CATEGORIES = {
        MYEXT: "myformat",
        // ...
    };

Code Style

  • Rust: Follow rustfmt defaults
  • TypeScript: Use Prettier with project config
  • Commits: Use Conventional Commits

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Commit changes (git commit -m 'feat: add amazing feature')
  4. Push to branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

πŸ“‹ Roadmap

  • Phase 1: Image conversion (7 formats)
  • Phase 2: Audio conversion (6β†’1 formats)
  • Phase 3: Web Worker architecture
  • Phase 4: UX improvements
  • Phase 5: Video conversion (FFmpeg WASM)
  • Phase 6: Advanced features (quality slider, metadata preservation)
  • Phase 7: Performance optimization (SIMD, multi-threading)
  • Phase 8: i18n support (PT-BR, EN, ES)

πŸ› Known Limitations

  • Animated GIFs: Only first frame is converted (limitation of image crate)
  • Audio Output: Only WAV output due to MP3/AAC patent licensing
  • Video: Not yet implemented (requires ~30MB FFmpeg WASM)
  • Progress Reporting: No granular progress bars (WASM limitation)

See IMPLEMENTATION_GUIDE.md for detailed technical documentation.


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Third-Party Licenses

  • image crate: MIT/Apache-2.0
  • symphonia: MPL-2.0
  • hound: Apache-2.0
  • wasm-bindgen: MIT/Apache-2.0
  • Next.js: MIT

πŸ™ Acknowledgments

Built with:

  • πŸ¦€ Rust - Systems programming language
  • πŸ•ΈοΈ WebAssembly - Portable binary format
  • βš›οΈ Next.js - React framework
  • πŸ“¦ wasm-bindgen - Rust/JS interop

Inspired by the need for private, client-side file conversion tools.


πŸ“§ Contact & Support


Made with ❀️ and Rust

Releases

Packages

Contributors

Languages