Skip to content

πŸ–ΌοΈ Web-based image editor built with Rust & WebAssembly. Apply filters, adjust colors, and process images in real-time with near-native performance. #Rust #WebAssembly #ImageProcessing

Notifications You must be signed in to change notification settings

automataIA/wasm-image-studio-rs

Repository files navigation

WASM Image Studio Logo

WASM Image Studio

Web-based image processing studio powered by Rust, WebAssembly, Leptos, and DaisyUI

Features β€’ Tech Stack β€’ Getting Started β€’ Contributing

πŸ–ΌοΈ Overview

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.

✨ Features

  • 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

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.

Manual Deployment

  1. Build the project:
    trunk build --release
  2. Copy the build output to the deployment directory:
    mkdir -p wasm-image-studio-rs
    cp -r dist/* wasm-image-studio-rs/
  3. 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/

Local Development

To run locally:

trunk serve --open

πŸ› οΈ Tech Stack

  • Frontend: Rust + WebAssembly
  • Framework: Leptos
  • Styling: Tailwind CSS, DaisyUI
  • Image Processing: photon-rs
  • Build Tool: Trunk
  1. Prerequisites

  2. Installation

    # Install Trunk
    cargo install trunk wasm-bindgen-cli
    
    # Add WebAssembly target
    rustup target add wasm32-unknown-unknown
  3. Development

    # Start development server
    trunk serve --open
  4. 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

πŸ› οΈ Tech Stack

  • 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

πŸš€ Getting Started

Prerequisites

  • Rust (latest stable version, 1.70+ recommended)
  • Node.js (v18 or later)
  • Trunk (Rust WASM web application bundler)
  • wasm-bindgen (for WebAssembly interop)

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/wasm-image-studio-rs.git
    cd wasm-image-studio-rs
  2. Install Rust WebAssembly target:

    rustup target add wasm32-unknown-unknown
  3. Install Trunk and wasm-bindgen:

    cargo install trunk wasm-bindgen-cli
  4. Install Node.js dependencies:

    npm install

🚧 Development

Running Locally

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.

Building for Production

Create an optimized production build:

trunk build --release

The production-ready files will be in the dist/ directory.

Project Structure

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

Styling Guidelines

  • 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

Testing

Run the test suite with:

cargo test

For end-to-end testing:

wasm-pack test --headless --firefox

🀝 Contributing

Contributions are welcome! Please follow these steps:

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

Code Style

πŸ“ License

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

πŸ™ Acknowledgments

  • 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

πŸ—οΈ Project Structure

.
# 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

About

πŸ–ΌοΈ Web-based image editor built with Rust & WebAssembly. Apply filters, adjust colors, and process images in real-time with near-native performance. #Rust #WebAssembly #ImageProcessing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages