A lightweight web app for automatically cropping images - removes transparent areas and uniform backgrounds. Built with Flask and Docker.
- Smart Cropping: Auto-crops transparency (PNG, GIF, WEBP) or uniform backgrounds (JPEG)
- Multiple Formats: PNG, JPEG, GIF, WEBP support
- Fast Processing: In-memory processing, no disk storage
- Drag & Drop: Simple file upload interface
- Format Preservation: JPEG stays JPEG, PNG stays PNG
- Docker Ready: Easy deployment
You can pull the latest pre-built image from Docker Hub or GitHub Container Registry.
Docker Hub:
docker pull pianonic/croptransparent:latestGitHub Container Registry:
docker pull ghcr.io/pianonic/croptransparent:latestThen, run the container:
docker run -d -p 5000:5000 --name croptransparent pianonic/croptransparent:latestThe application will be available at http://localhost:5000.
1. Create a compose.yaml file:
Use your favorite editor to create a compose.yaml file and paste this into it:
services:
croptransparent:
image: pianonic/croptransparent:latest # Uses the image from Docker Hub
# image: ghcr.io/pianonic/croptransparent:latest # Uses the image from GitHub Container Registry
ports:
- "5000:5000"
restart: unless-stopped2. Start it:
docker compose up -dThe application will be available at http://localhost:5000.
# Clone the repository
git clone https://github.com/Pianonic/CropTransparent.git
cd CropTransparent
# Create a virtual environment
python -m venv venv
# On Linux/macOS:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python wsgi.pyThe application will be available at http://localhost:5000 (or the port configured in wsgi.py).
- Upload an image (drag & drop or browse)
- App automatically detects and crops transparent areas or uniform backgrounds
- Preview and download the cropped result
Uses PIL/Pillow and NumPy for smart cropping:
- Transparent images: Crops based on alpha channel
- Opaque images: Detects uniform background from corners and crops
- Security: All processing in memory, no files saved to disk
- Python 3.13+
- Docker
- Dependencies: Shown in requirements.txt
This project is licensed under the MIT License. See the LICENSE file for more details.
Made with ❤️ by Pianonic


