Computer Vision

Custom Background Removal for Print

A Profiling-Driven Image Pipeline Case Study

Sub-second background removal and a 4× higher resolution ceiling for a production DTF print pipeline

Python · OpenCV · NumPy · pyVips · FastAPI
<1s
Background Removal
down from 8 s
−75%
Normalisation Time
12 s → 3 s
4×
Resolution Ceiling
24 MP → 100+ MP
2 px
Fine Detail Kept
print-safe transparency
1. The Challenge

Processing had become the bottleneck

A production Direct-to-Film (DTF) print pipeline removes the background from every customer upload before printing. Processing had become the bottleneck: each image took tens of seconds, and large files had to be capped at 24 MP.

The hard constraint: Print quality could not be traded for speed — thin strokes, fine filaments and soft edges all have to survive onto transparency cleanly. Any solution that gained speed by losing 2 px of edge fidelity was not acceptable.
2. How We Approached It

Profile before optimising

Measured every stage end-to-end to find where the time was actually going, instead of guessing or buying bigger servers.

Purpose-built algorithm

Designed a custom background-removal algorithm for print artwork instead of relying on a general-purpose segmentation tool.

Built for very large images

Re-engineered the data path for multi-core, memory-efficient processing, so 100+ MP files run as smoothly as small ones.

Quality as a hard constraint

Validated every speed-up against fine-detail test artwork, so no gain in speed cost anything in print quality.

Image normalisation −75%
before / after — bars drawn to a common scale (12 s = full width)
12 s
3 s
Background removal >8× Faster
before / after
8 s
<1 s
3. Toolkit
Computer vision OpenCV NumPy pyVips
Service Python FastAPI
Practice Micro-profiling Parallel processing Quality benchmarking
4. Outcomes
Metric Before After Improvement
Image normalisation 12 s 3 s −75% Time
Background removal 8 s <1 s >8× Faster
Max input resolution 24 MP 100+ MP 4× Ceiling
Fine-edge fidelity Baseline 2 px detail kept No quality loss

Strategic Business Value

Note: Implementation details are proprietary to the client. Available for deeper technical discussion under NDA.
← Back to Sagacitas