Back to Tools

eCommerce Image Centering Tool

Use cases

Standardising product photos for marketplaces Adding consistent padding and backgrounds Correcting off-center product shots Batch processing catalog images

Uses OpenCV cascading thresholding (240, 230, 220, 200, Adaptive Gaussian 21×21, Otsu) with morphological operations (5×5 kernel closing/opening) to detect product subjects.

Centers by finding bounding box of all contours above 1% image area.

Supports batch processing with ZIP export, manual offset adjustments, and configurable output sizes.

Streamlit App

Platform

Browser-based (no installation required)

Input

Product images

Output size and background settings

Output

Centered product images (ZIP for batch)

Launch App View Source

Features

  • Cascading threshold detection (240, 230, 220, 200, then Adaptive and Otsu)
  • Morphological cleanup with 5×5 kernels
  • Crops to the detected subject plus 5% margin (contours over 1% of image area)
  • Output sizes: 600×600, 800×800, 1000×1000, or custom
  • Padding 0-30% with hex colour picker
  • Manual horizontal/vertical offset (±100px)
  • JPEG/WEBP export with batch ZIP download

How to use

  1. 1 Upload product images (batch supported)
  2. 2 Select output size and format (JPEG/WEBP)
  3. 3 Configure padding and background color
  4. 4 Preview detection with debug visualisation
  5. 5 Adjust manual offsets if needed
  6. 6 Download individual images or batch ZIP

Frequently asked questions

What kind of product photos does the detection work best on?
Photos on white or near-white backgrounds. The tool separates subject from background by grayscale thresholding, trying cutoffs of 240, 230, 220 and 200 in turn, then falling back to adaptive Gaussian and Otsu thresholding. If no usable contour is found at any stage, the image is simply resized onto the canvas without recentring, so busy or dark backgrounds may come through unchanged.
Does the tool crop my image?
Yes. It crops to the combined bounding box of all detected contours plus a 5% margin, then rescales that crop onto the output canvas. Contours smaller than 1% of the image area are ignored as noise, so tiny detached elements such as faint shadows or small labels can be cropped out.
Is transparency preserved in the output?
No. Uploads are converted to RGB on load and output is always JPEG or WEBP on a solid background, chosen with the hex colour picker (white by default). If you upload a transparent PNG, the transparency is discarded before processing, which can also confuse subject detection.
The subject is centred wrongly. How do I debug it?
Tick 'Show detection visualization' in the results. It overlays a crosshair on the detected centre and shows the four binary threshold masks side by side, so you can see which thresholding pass fired and whether background clutter was picked up as part of the subject. You can then correct with the manual horizontal and vertical offset sliders (plus or minus 100px in 5px steps).
How does batch download work?
The ZIP download only appears when you upload more than one image, and the whole batch is exported in a single format (JPEG or WEBP) chosen at download time. Per-image format selection is available on the individual download buttons.

Need something built for your business?

This tool started as bespoke client work. I build custom scripts, data pipelines, and full apps for SEO and product data problems that off-the-shelf tools don't solve.

Tell Me What You Need