cd /news/computer-vision/cutting-out-big-product-photos-mask-… · home › topics › computer-vision › article
[ARTICLE · art-169473] src=dev.to ↗ pub= topic=computer-vision verified=true sentiment=· neutral

Cutting out big product photos: mask resizing cost 1.5 of 255, the model cost 54

A developer benchmarked ImgIng's browser-based background remover, measuring that resizing a photo to a model's native input resolution costs only about 1 to 1.5 out of 255 in mask error, while the choice of model accounts for roughly 54. Testing ISNet INT8, BEN2 FP16 and BiRefNet HR-Matting on a portrait, a wine glass and a white cup, the developer found that feeding ISNet a 2048 input instead of its native 1024 collapsed the median mask value from 0.975 to 0.223, and that a guided-filter edge-refinement pass made no improvement (54.07 to 55.01 versus 54.22 for plain bilinear). The recommended batch strategy is to pick a tier by its native resolution, route white goods through the pro tier, and expect model downloads of 44.2 MB, 219.1 MB and 447.3 MB on first use.

by read4 min views3 publishedNov 14, 2026

Picture a one-person shop with a few hundred product shots off a 24-megapixel camera and one weekend to cut them all out. Three things are worth settling first, and one test run on an Apple-silicon Mac in a desktop browser put numbers on each. The cutouts came from ImgIng's browser background remover https://imging.ai/ , which has fast, pro and heavy model tiers, and the error checks were run offline with OpenCV and ONNX Runtime on the same ISNet INT8 file the fast tier downloads. Samples: one long-haired portrait, one empty wine glass on white, one white porcelain cup on white. One photo per type, one run each, so every result means "on these photos".

The config the ImgIng page loads says the fast tier (ISNet INT8) and the pro tier (BEN2 FP16) run at 1024 by 1024, and the heavy tier (BiRefNet HR-Matting FP16) at 2048 by 2048. The photo is resized to that square going in and the mask is stretched back to full size coming out, with no edge-refinement pass between. Feeding the same ISNet file a 2048 input shows why. The median of its output mask on the portrait dropped from 0.975 to 0.223, which leaves a useless mask. The likely reason, an inference rather than a measurement, is that a model trained at one resolution expects subjects at about that scale. So the rule for the batch is to pick a tier by its native size and let the tool scale, rather than hunt for a way to push a 6000-pixel original through untouched. The bill a solo dev should watch is the download: 44.2 MB, 219.1 MB and 447.3 MB for the three model files, fetched on first use. The network capture covered the three samples on the fast and pro tiers plus one sample on the heavy tier, and showed no request up an image, only those downloads.

To separate upscaling loss from everything else, the portrait (a 2048 square crop) was shrunk to 768, 1024, 1440 and 1920 on a side. The reference mask came from the heavy tier on the 2048 photo, a bigger model's answer and not ground truth. Error counted only in a hair band, pixels the reference puts between 0.02 and 0.98 alpha plus about 2 px around them, as mean absolute difference on a 0 to 255 scale. An "ideal model" control took the reference down to 1024 and back, leaving only resolution loss: 1.51 bilinear and 0.73 bicubic at 1.41x, 1.43 and 0.79 at 1.88x. The fast-tier model sat 51.57, 55.32, 53.85 and 54.22 away from the reference at the four sizes. On this one portrait, resizing costs about 1 to 1.5 out of 255, the model costs around 54, and the 54 does not climb as the photo grows. In sparse strands the fast model's alpha was about 1.45 times the reference, so it called the fringe more solid rather than losing it.

A guided filter sounded like the fix and made no difference. At 1920, a sweep of r 1, 2, 4 against eps 1e-6, 1e-4, 1e-2 on the fast model landed at 54.07 to 55.01, next to 54.22 for plain bilinear. On the ideal control the default setting pushed error from 1.51 or less to between 11.42 and 14.96 across the four sizes, by softening edges the reference had sharp. Per-region tuning or a trimap might help, but neither was tried, so that is a guess. The reference itself draws loose flyaway hairs as part of one clump, so these numbers grade the outline of the hair mass, not single strands.

With the model deciding the edge, the lever left is time. On the portrait the fast tier kept the body of the hair but dropped most stray strands as background, and the pro tier kept a few more while leaving semi-transparent holes inside the hair mass. The wine glass beat both: the fast tier filled the empty bowl as solid white, mean alpha 251.8 of 255 between rim and wine, and the pro tier reached 241.7 with a white haze outside. The white cup was the easy case, the pro tier's saucer edge clean with 4.29% of pixels semi-transparent against 26.96% on fast. So the batch splits by type. White goods go through the pro tier and, going by one cup, may ship as exported, model shots with loose hair get a pass with the refine brush, and glassware gets the most minutes; whether the brush can restore real transparency in a glass was not tested. Timing five photos of each type before the weekend is the cheapest check in the plan.

One photo per category, one machine. The error table stops at 1920 and covers only the fast-tier model. No other tool's cutouts were measured, so none of this ranks one remover against another.

Sample photos via Wikimedia Commons: "Windblown" by Kaci Baum (CC0), "Glass wine white background" by Paolo Neo (public domain), "Cup of tea isolated on white background" by Petr Kratochvil (CC0).

── more in #computer-vision 4 stories · sorted by recency
── more on @imging 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/cutting-out-big-prod…] indexed:0 read:4min 2026-11-14 · —