
Web-based image processing studio powered by Rust, WebAssembly, Leptos, and DaisyUI
Features β’ Tech Stack β’ Getting Started β’ Contributing
WASM Image Studio is a high-performance, web-based application for applying a variety of image filters and effects in real time. Built with Rust and compiled to WebAssembly, it delivers near-native performance in your browser. The app features a modern drag-and-drop interface, instant filter previews, and export capabilities for your edited images.
- Modern UI: Clean, responsive interface built with DaisyUI and Tailwind CSS
- Dark/Light Mode: Toggle between themes
- Drag & Drop: Upload images by dragging and dropping onto the canvas
- Real-time Filter Previews: Instantly see changes as you adjust settings
- Multiple Filter Types: Grayscale, Sepia, Blur, Brightness, Contrast, Hue rotation, Saturation, Invert, Edge detection, Sharpen
- Adjustable Intensity: Fine-tune each filter with precision controls
- Responsive Design: Works on desktop and mobile
- Export: Save edited images as PNG, JPEG, or WEBP
- Accessibility: Built with accessible design in the mind
Deployment to GitHub Pages is automated. Every push to the main
branch will trigger deployment to the gh-pages
branch in the wasm-image-studio-rs/
directory.
- Build the project:
trunk build --release
- Copy the build output to the deployment directory:
mkdir -p wasm-image-studio-rs cp -r dist/* wasm-image-studio-rs/
- Switch to the
gh-pages
branch and copy the files:git checkout gh-pages git pull rm -rf wasm-image-studio-rs mkdir -p wasm-image-studio-rs cp -r ../dist/* wasm-image-studio-rs/ git add wasm-image-studio-rs git commit -m "Update wasm-image-studio-rs" git push origin gh-pages
The app will be available at: https://automataia.github.io/wasm-image-studio-rs/
To run locally:
trunk serve --open
- Frontend: Rust + WebAssembly
- Framework: Leptos
- Styling: Tailwind CSS, DaisyUI
- Image Processing: photon-rs
- Build Tool: Trunk
-
Prerequisites
-
Installation
# Install Trunk cargo install trunk wasm-bindgen-cli # Add WebAssembly target rustup target add wasm32-unknown-unknown
-
Development
# Start development server trunk serve --open
-
Build for Production
trunk build --release
- Hue rotation
- Saturation adjustment
- Invert colors
- Edge detection
- Sharpen
- Adjustable Intensity - Fine-tune each filter with precision controls
- Responsive Design - Works on both desktop and mobile devices
- Export Functionality - Save your edited images in multiple formats (PNG, JPEG, WEBP)
- Accessible - Built with accessibility in mind
- Frontend Framework: Leptos (v0.8) - Full-stack web framework for Rust
- UI Components: DaisyUI (v4.12.0) - Clean, customizable component library
- Styling: Tailwind CSS (v3.4.3) - Utility-first CSS framework
- Image Processing:
photon-rs
- High-performance image processing in Rust - Build Tool: Trunk - WASM web application bundler
- Language: Rust with WebAssembly for near-native performance
- Rust (latest stable version, 1.70+ recommended)
- Node.js (v18 or later)
- Trunk (Rust WASM web application bundler)
- wasm-bindgen (for WebAssembly interop)
-
Clone the repository:
git clone https://github.com/your-username/wasm-image-studio-rs.git cd wasm-image-studio-rs
-
Install Rust WebAssembly target:
rustup target add wasm32-unknown-unknown
-
Install Trunk and wasm-bindgen:
cargo install trunk wasm-bindgen-cli
-
Install Node.js dependencies:
npm install
Start the development server with hot-reloading:
trunk serve --open
The application will be available at http://localhost:3000
and will automatically reload when you make changes.
Create an optimized production build:
trunk build --release
The production-ready files will be in the dist/
directory.
wasm-image-studio-rs/
βββ src/
β βββ components/ # Reusable UI components
β β βββ drag_drop.rs # File upload component
β β βββ filter_controls.rs # Filter controls panel
β β βββ image_canvas.rs # Image display and processing
β β βββ export_panel.rs # Image export controls
β β
β βββ pages/ # Application pages
β β βββ home.rs # Main application page
β β
β βββ filters/ # Image filter implementations
β βββ lib.rs # Library root
β βββ main.rs # Application entry point
β
βββ public/ # Static assets
βββ styles/ # Global styles
βββ index.html # Main HTML entry point
- Use Tailwind CSS utility classes for styling
- Follow DaisyUI component patterns where possible
- Maintain consistent spacing using Tailwind's spacing scale
- Use semantic HTML elements with appropriate ARIA attributes
- Follow the project's color scheme defined in
tailwind.config.js
Run the test suite with:
cargo test
For end-to-end testing:
wasm-pack test --headless --firefox
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow the Rust API Guidelines
- Use
rustfmt
for code formatting - Run
clippy
for linting
This project is licensed under the MIT License - see the LICENSE file for details.
- Leptos for the awesome Rust web framework
- Photon-rs for image processing
- Trunk for WASM application bundling
- All contributors who have helped improve this project
.
# Root
βββ Cargo.toml # Rust project configuration and dependencies
βββ Cargo.lock # Lock file for Rust dependencies
βββ index.html # Main HTML entry point with root element for the WASM app
βββ input.css # Global styles and Tailwind CSS imports
βββ Trunk.toml # Trunk configuration
βββ info/ # Project documentation
β βββ structure.md # Detailed project structure documentation
# Source Code
βββ src/
β βββ components/ # Reusable UI components
β β βββ app_layout.rs # Main application layout
β β βββ counter_btn.rs # Counter button component
β β βββ drag_drop.rs # File upload component
β β βββ export_panel.rs # Image export controls
β β βββ filter_controls.rs # Filter adjustment controls
β β βββ image_canvas.rs # Image display and manipulation
β β βββ mod.rs # Components module exports
β β
β βββ filters/ # Image processing filters
5. Open a Pull Request
## π License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## π Acknowledgments
- [Leptos](https://leptos.dev/) β Rust full-stack web framework
- [photon-rs](https://github.com/silvia-odwyer/photon) β Image processing
- [Tailwind CSS](https://tailwindcss.com/) β Styling
- [Trunk](https://trunkrs.dev/) β WASM bundler