Skip to content

PianoNic/CropTransparent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CropTransparent

CropTransparent Logo

A lightweight web app for automatically cropping images - removes transparent areas and uniform backgrounds. Built with Flask and Docker.

visits

🚀 Features

  • 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

📸 Screenshots (Light and Darkmode)

CropTransparent Homepage

CropTransparent Processed Page

📦 Installation

Using Docker (Recommended)

Option 1: Pull and Run a Pre-built Image

You can pull the latest pre-built image from Docker Hub or GitHub Container Registry.

Docker Hub:

docker pull pianonic/croptransparent:latest

GitHub Container Registry:

docker pull ghcr.io/pianonic/croptransparent:latest

Then, run the container:

docker run -d -p 5000:5000 --name croptransparent pianonic/croptransparent:latest

The application will be available at http://localhost:5000.

Option 2: Run with Docker Compose

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-stopped

2. Start it:

docker compose up -d

The application will be available at http://localhost:5000.

Manual Installation

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

The application will be available at http://localhost:5000 (or the port configured in wsgi.py).

🛠️ Usage

  1. Upload an image (drag & drop or browse)
  2. App automatically detects and crops transparent areas or uniform backgrounds
  3. Preview and download the cropped result

⚙️ Technical Details

Image Processing

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

📋 Requirements

📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.


Made with ❤️ by Pianonic

About

Automatically crop transparent areas from Images

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •