A Streamlit application that automatically centres product images for consistent eCommerce displays.
- Automatic detection of the main subject in product images
- Background removal for products on white/light backgrounds
- Consistent sizing with customisable dimensions
- WebP support
- Batch processing for multiple images
- Visual debugging to see detection methods
- Manual adjustments for fine-tuning positioning
- Python 3.7+
- Streamlit
- OpenCV
- NumPy
- Pillow
git clone https://github.com/LeeFoot/ecommerce-image-centering.git
cd ecommerce-image-centering
pip install -r requirements.txtstreamlit run app.pyThen open your browser to http://localhost:8501
- Upload your product images
- Adjust settings in the sidebar if needed
- Download processed images individually or in batch
- Import into your eCommerce platform
The tool uses computer vision techniques to:
- Detect the main subject using multiple thresholding methods
- Remove backgrounds (optional)
- Centre the product in the frame
- Apply consistent padding
- Export to your desired dimensions
| Original | Processed |
|---|---|
![]() |
![]() |
Lee Foot - eCommerce SEO Consultant
MIT License
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

