A WebAssembly-powered image manipulation tool built with Rust and JavaScript. This application applies grayscale effects to images directly in your browser using the power of WebAssembly for high-performance image processing.
- Fast Image Processing: Leverages Rust compiled to WebAssembly for near-native performance
- Multiple Format Support: Supports PNG, JPG, and JPEG image formats
- Grayscale Filter: Convert your images to grayscale instantly
- Client-Side Processing: All image processing happens in your browser - no server uploads required
- Beautiful UI: Modern, responsive interface with animated gradient backgrounds
- Rust: Core image processing logic
- WebAssembly (WASM): Compile Rust to run in the browser
- JavaScript: Frontend interaction and file handling
- Webpack: Module bundling and development server
- Tailwind CSS: Styling and responsive design
- wasm-pack: Building and packaging WebAssembly modules
Before running this project, make sure you have installed:
- Clone this repository:
git clone <repository-url>
cd WebRust-main- Install Node dependencies:
npm installRun the development server with hot reload:
npm run serveThe application will be available at http://localhost:8080
Create an optimized production build:
npm run buildThe compiled files will be in the dist/ directory.
- Upload an Image: Click the upload button and select a PNG, JPG, or JPEG image
- Processing: The image is converted to base64, sent to the Rust/WASM module
- Grayscale Conversion: Rust processes the image using the
imagecrate - Display: The processed image is displayed on the page
.
├── src/
│ └── lib.rs # Rust source code for image processing
├── Public/
│ ├── index.html # HTML template
│ └── main.js # JavaScript entry point
├── Cargo.toml # Rust dependencies
├── package.json # Node dependencies and scripts
├── webpack.config.js # Webpack configuration
└── README.md # This file
wasm-bindgen- Interoperability between Rust and JavaScriptbase64- Base64 encoding/decodingimage- Image processing libraryweb-sys- Web API bindings for console logging
webpack- Module bundlerwebpack-dev-server- Development server@wasm-tool/wasm-pack-plugin- Webpack plugin for wasm-packhtml-webpack-plugin- HTML file generation
Potential features to add:
- Additional filters (sepia, blur, brightness, contrast)
- Batch processing for multiple images
- Image resize and crop functionality
- Download processed images
- Before/after comparison slider
- Custom filter intensity controls
WebAssembly provides near-native performance for image processing tasks. The grayscale conversion is significantly faster than pure JavaScript implementations, especially for large images.
This application requires a modern browser with WebAssembly support:
- Chrome 57+
- Firefox 52+
- Safari 11+
- Edge 16+
ISC
Norman - Built with love ❤️
This project demonstrates the power of combining Rust and WebAssembly for high-performance web applications.