Skip to content

Modern web GUI for ImageMagick with AI-powered background removal, batch processing, and real-time preview. Built with Next.js, FastAPI, and Docker.

License

Notifications You must be signed in to change notification settings

PrzemekSkw/imagemagick-webui

ImageMagick WebGUI Icon

ImageMagick WebGUI


Stars Forks Issues License Docker Pulls

A modern, beautiful web interface for ImageMagick with AI-powered features

Features β€’ Quick Start β€’ Configuration β€’ Documentation β€’ Contributing


πŸ“½οΈ Demo Video

imagemagick.mp4

✨ Features

🎨 Image Processing

  • Resize & Crop - Precise dimensions, percentage scaling, aspect ratio lock
  • Format Conversion - WebP, AVIF, JPEG, PNG, GIF, TIFF, PDF support
  • Filters & Effects - Blur, Sharpen, Grayscale, Sepia, Brightness, Contrast, Saturation
  • Watermark & Text - Custom text overlays with position, opacity, and font size control
  • Rotate & Flip - 90Β°, 180Β°, 270Β° rotation with horizontal/vertical flip
  • Batch Processing - Process multiple images simultaneously

πŸ€– AI-Powered Features

  • Background Removal - One-click AI background removal using rembg
  • Auto Enhance - Automatic image enhancement (normalize, saturation, sharpening)
  • Smart Upscaling - 2x/4x resolution upscaling with LANCZOS algorithm

πŸ–₯️ User Interface

  • Notion-inspired Design - Ultra-clean, minimalist white interface
  • Real-time Preview - See changes before applying
  • Drag & Drop Upload - Easy multi-file upload
  • Image Editor - Full-featured editor with live preview
  • Terminal Mode - Direct ImageMagick command input for power users
  • Dark/Light Mode - Automatic or manual theme switching
  • PWA Support - Install as desktop/mobile app

πŸ”§ Technical

  • Docker Ready - One command deployment
  • Type-Safe - Full TypeScript + Pydantic validation
  • Secure - Command whitelist, timeouts, resource limits
  • Queue System - Redis-based job queue for heavy operations
  • History - Track all processed images with re-download option

πŸš€ Quick Start

mkdir imagemagick-webgui && cd imagemagick-webgui
curl -O https://raw.githubusercontent.com/PrzemekSkw/imagemagick-webui/main/docker-compose.example.yml
mv docker-compose.example.yml docker-compose.yml
docker compose up -d

Access: http://localhost:3000

πŸ“– Need custom ports, authentication, or reverse proxy? See Installation Guide

⚠️ Production: Change SECRET_KEY and JWT_SECRET in docker-compose.yml before deploying!

πŸ“– Documentation

Default Ports

Service Port Description
Frontend 3000 Next.js web interface
Backend 8000 FastAPI REST API
PostgreSQL 5432 Database (internal)
Redis 6379 Queue system (internal)

API Documentation

Once running, access the interactive API docs:

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Next.js 15    │────▢│    FastAPI      β”‚
β”‚   (Frontend)    β”‚     β”‚   (Backend)     β”‚
β”‚   Port: 3000    β”‚     β”‚   Port: 8000    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                         β”‚
              β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
              β”‚ PostgreSQLβ”‚           β”‚     Redis     β”‚
              β”‚   (DB)    β”‚           β”‚   (Queue)     β”‚
              β”‚ Port: 5432β”‚           β”‚  Port: 6379   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                                      β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
                                      β”‚  RQ Worker    β”‚
                                      β”‚ (Background)  β”‚
                                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Supported Operations

Operation Parameters Example
resize width, height, percent, fit {"width": 800, "height": 600}
crop x, y, width, height {"x": 0, "y": 0, "width": 500, "height": 500}
rotate degrees {"degrees": 90}
flip direction {"direction": "horizontal"}
blur sigma {"sigma": 10}
sharpen sigma {"sigma": 2}
brightness value {"value": 120}
contrast value {"value": 110}
saturation value {"value": 130}
grayscale - {}
sepia-tone threshold {"threshold": 80}
watermark text, position, font_size, opacity {"text": "Β©2024", "position": "southeast"}
format format, quality {"format": "webp", "quality": 85}

Terminal Mode

For advanced users, use Terminal Mode to run raw ImageMagick commands:

# Convert to WebP with quality
magick input.jpg -quality 80 output.webp

# Create thumbnail
magick input.jpg -thumbnail 300x300 output.jpg

# Add border
magick input.jpg -border 10x10 -bordercolor "#ff0000" output.jpg

# Composite images
magick base.jpg overlay.png -composite output.jpg

πŸ“Έ Screenshots

Click to view screenshots

Dashboard

Dashboard

Image Editor

Editor

Dark Mode

Dark Mode

Settings

Settings


πŸ› οΈ Development

Local Development (without Docker)

Backend:

cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

Frontend:

cd frontend
npm install
npm run dev

Running Tests

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

Project Structure

imagemagick-webui/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/          # API endpoints
β”‚   β”‚   β”œβ”€β”€ core/         # Config, security, database
β”‚   β”‚   β”œβ”€β”€ models/       # SQLAlchemy models
β”‚   β”‚   β”œβ”€β”€ services/     # Business logic
β”‚   β”‚   └── workers/      # Background tasks
β”‚   β”œβ”€β”€ tests/
β”‚   └── requirements.txt
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ app/              # Next.js App Router pages
β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”œβ”€β”€ features/     # Feature components
β”‚   β”‚   β”œβ”€β”€ layout/       # Layout components
β”‚   β”‚   └── ui/           # UI primitives (shadcn/ui)
β”‚   └── lib/              # Utilities, API client, store
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Dockerfile
└── README.md

πŸ”’ Security

  • Command Whitelist - Only allowed ImageMagick operations
  • Input Validation - Pydantic models for all inputs
  • Resource Limits - Memory (2GB), timeout (300s), disk limits
  • File Validation - MIME type and extension checking
  • Rate Limiting - Configurable request limits
  • Non-root Container - Runs as unprivileged user

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

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

πŸ“„ License

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


πŸ’– Support

If you find this project useful, please consider supporting its development:

Buy Me A Coffee

PayPal

GitHub Sponsors

Your support helps maintain and improve this project. Thank you! ❀️


⭐ Star History

Star History Chart


πŸ™ Acknowledgments


Made with ❀️ by PrzemekSkw

About

Modern web GUI for ImageMagick with AI-powered background removal, batch processing, and real-time preview. Built with Next.js, FastAPI, and Docker.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •