OsCrop is a simple yet powerful open-source tool for:
- 🧼 Removing backgrounds from images (PNG, JPG, WEBP)
- ✂️ Automatically cropping the main object
- 🎯 Outputting clean 512x512 images centered on transparent backgrounds
Made for creators and developers who want fast, clean asset extraction — perfect for Telegram stickers, digital design, AI datasets, and more.
📸 Use Cases
Whether you're a creator, developer, or just someone working with digital visuals — OsCrop simplifies your workflow.
- 🧩 Creating Telegram, WhatsApp, or Discord stickers
- 🛍️ Cleaning up product images for online shops
- 🧠 Preparing consistent assets for machine learning datasets
- 🎨 Extracting and isolating emoji, clipart, avatars, or sprites
- 📚 Streamlining bulk image cleanup for digital archives or design packs
- 🔍 Detects objects using alpha transparency or shape detection
- 🧼 Cleans up black glow or leftover outlines
- 🪄 Automatically centers and resizes objects onto transparent 512x512 canvases
- 🧠 Skips previously processed images
- 🔁 Full automation pipeline (removal + cropping)
- 🧰 Supports PNG, JPG, and WEBP
- 🔐 Includes author license check with anti-tamper
OsCrop/
├── oscrop_full.py # Full pipeline: background removal + crop + resize
├── oscrop_bg_remover.py # Only removes background using rembg
├── oscrop_auto_alpha_crop.py # Auto-crops transparent PNGs using alpha mask
├── oscrop_crop_detect.py # Crops non-transparent PNG/JPG/WEBP using object detection
├── run_oscrop.py # Easy launcher script for non-developers
├── LICENSE # Os Public License v1.0
├── README.md # You're reading it
├── requirements.txt # Python dependencies
└── samples/ # Includes sample images for testing
Make sure you have Python 3.8 or higher installed.
pip install rembg opencv-python pillow numpy
✅ Python 3.8 or higher recommended
❌ No GPU required
💻 Works on Windows, Mac, Linux (tested)
python run_oscrop.py
This will show a menu to choose:
- Full Process
- Background Only
- Crop Transparent PNGs
- Crop Non-Transparent Images
You’ll be asked to set or confirm your input_folder
.
Make sure to set
input_folder
in each script before running.
python oscrop_full.py
Creates output_no_bg/output_crops/
python oscrop_bg_remover.py
Creates output_no_bg/
python oscrop_auto_alpha_crop.py
Creates alpha_crops/
folder
python oscrop_crop_detect.py
Creates shape_crops/
folder
🔄 If
oscrop_auto_alpha_crop.py
detects no alpha channel, it will skip and suggest usingoscrop_crop_detect.py
. 🧠oscrop_crop_detect.py
also skips full-sheet crops intelligently if they cover the whole image.
- All cropped images are centered and padded into clean
512x512
boxes - Output folders like
alpha_crops
,shape_crops
,output_crops
are created automatically - Files are named sequentially like
alpha_crop_1.png
,detect_crop_3.png
, etc
Included in the samples/
folder:
dark_bg.png
– Object sheet with dark backgroundwhite_bg.png
– Object sheet with white backgroundtransparent_sheet.png
– PNG with alpha background
You can test the tools on these to see how they behave in different scenarios.
Os Public License v1.0
Copyright (c) 2025 Os (Osman Vision)
You are free to use, modify, and distribute the code,
BUT the author credit must remain visible.
Tampering with the license block or removing author lines
may result in broken functionality.
For commercial licensing, contact: [email protected]
- Instagram: @osman_vision
- Email: [email protected]
- Discord: osman_vision
🔧 Powered by OsCrop by Osman Vision