Skip to content

baslie/stripeoff

Repository files navigation

StripeOff

Before and after example

StripeOff — a simple application for removing empty (white or transparent) borders from images. Drag and drop files or a folder — the program will process everything automatically.

Features

  • Drag-and-drop interface
  • Folder support (recursive processing of all images)
  • Transparent PNG support (alpha channel preserved on output)
  • Localization: Russian and English
  • Processing history with progress display
  • Supported formats: PNG, JPG, JPEG, BMP, WebP

How It Works

The app uses OpenCV and NumPy to detect and remove empty borders:

  1. Empty pixel detection — a pixel is considered empty if it is transparent (alpha ≤ 5) or white (all RGB channels ≥ 250)
  2. Border scanning — the algorithm builds a 2D mask and finds the first and last non-empty rows and columns
  3. Minimum threshold — borders narrower than 5 pixels are ignored to avoid false positives
  4. Cropping — the image is cropped to the detected content boundaries, preserving the alpha channel for PNG/WebP

This approach is fast and works well with scanned documents, screenshots, images with uniform white margins, and PNG exports with transparent padding (Figma, Photoshop, etc.).

How to Use

  1. Run remove_borders_app.py
  2. Drag images or a folder into the program window
  3. Processed files are saved next to the originals with the _cropped suffix

Application screenshot

Installation

Option 1: Installer (recommended)

Download StripeOff_Setup_1.0.0.exe from Releases and run it. The installer will create shortcuts on the desktop and in the Start menu.

Option 2: Portable version

Download StripeOff.exe from Releases — runs without installation.

Option 3: From source

Requires Python 3.9+

pip install -r requirements.txt
python remove_borders_app.py

Building

Portable EXE

pip install pyinstaller
pyinstaller StripeOff.spec

Installer

Requires Inno Setup 6.

build_installer.bat

Output:

  • dist/StripeOff.exe — portable version
  • dist/StripeOff_Setup_1.0.0.exe — installer

License

MIT

About

Simple app for removing white borders from images

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors