Part 4 of 7 · Product image cleaner series ~7 min read

How channel variants get made

A clean cutout on transparency is not a catalogue. Each sales channel wants its own size, its own background, and its own rules about what’s allowed in the frame. This post is about turning one cutout into the full set: the deterministic Pillow steps that crop, pad, resize, and compose every variant — and the watermark rule that exists because marketplaces reject images that carry one.

Key takeaways

  • One trusted cutout fans out into a full set of channel variants — web store, marketplace square, and social.
  • Every step is plain deterministic Pillow arithmetic: trim to the product, pad to the safe area, resize, composite, watermark.
  • Cropping is driven by the alpha channel — the tight bounding box of the actual product, not the original frame.
  • The marketplace variant carries no watermark on purpose, because the big marketplaces reject main images that do.
  • Same cutout, same config, same output every time — no model decides a crop, a size, or where the logo goes.

From one cutout to many

The cutout that arrives from Part 3 is a single transparent PNG: the product floating on nothing, at whatever size and position it happened to sit in the original photo. That’s not a catalogue, because no two channels want the same thing. A web store wants a roomy image with breathing space around the product. A marketplace wants a tight square on pure white with the product filling most of the frame and absolutely no logo. Social wants a square that looks good in a grid, branded with a faint watermark. The variant step takes the one cutout and produces all of them, and it does so with no model at all — every decision is fixed arithmetic against the config you set once.

That determinism is the whole point. The hard, uncertain judgement — what’s product and what’s background — was made and checked in the cutout step. Everything here is mechanical: given this cutout and this channel spec, there is exactly one correct output, and the same inputs always produce it. Run the same candle through twice and you get byte-for-byte the same web image, which is what makes a catalogue look like a catalogue instead of a scrapbook.

Crop, pad, resize

The first move is the same for every channel and it’s why the cutout had to come first: trim to the product. The alpha channel tells you exactly which pixels are product, so the function computes the tight bounding box of everything non-transparent and discards the empty margins. Now the product is the image, regardless of where it sat in the original snap or how much counter was around it. This is the step that makes a phone photo taken from across the room and one taken up close come out looking identical.

From that trimmed product, each channel applies its own spec, all of it deterministic:

  • Pad to the safe area. Each channel sets how much breathing space to leave — the product is scaled to fill a target fraction of the frame and centred. The web store leaves a generous margin (the product fills about 80% of the frame); the marketplace square fills more tightly (around 90%, because marketplaces want the product big); social sits in between.
  • Resize to the exact pixels. The padded canvas is resized to the channel’s precise dimensions with a high-quality filter — 1600×1600 for the web store, 2000×2000 for the marketplace, 1080×1080 for social — so every image in a listing is pixel-identical in size and the channel never has to re-scale it.
  • Composite the background. Where the channel wants white, the product is laid over a pure #ffffff canvas and flattened to a JPEG; where it wants transparency, it’s kept as a PNG with the alpha intact. White for the marketplace (they require it), transparency offered for the web store so it sits on any page colour.
One cutout fanned out into three channel variants by deterministic image ops On the left, a box for the trusted cutout PNG. An arrow leads to a Trim box that crops to the product’s alpha bounding box. From Trim, three branches fan out to the right, one per channel, each a small chain of steps. Top branch, Web store: pad to eighty percent, resize to 1600 by 1600, transparent or white, watermark yes, output to out slash web. Middle branch, Marketplace: pad to ninety percent, resize to 2000 by 2000, pure white background, watermark NO in capitals, output to out slash market. Bottom branch, Social: pad, resize to 1080 by 1080, branded background, watermark yes, output to out slash social. A note highlights that the marketplace branch is the only one with no watermark, because marketplaces reject main images that carry one. A bottom note reads: same cutout, same config, same output every time — no model decides a crop or a size. cutout.png trusted Trim to alpha bbox (product = image) Web store 80% fill · 1600×1600 white/transparent · watermark out/web/ Marketplace 90% fill · 2000×2000 pure white · watermark NO out/market/ Social 85% fill · 1080×1080 branded · watermark out/social/ Same cutout, same config, same output every time — and the marketplace variant never carries a watermark.
Fig 4. One trimmed cutout fans out into three variants. Each branch applies its own fill, size, background, and watermark rule deterministically. The marketplace square is the one with no watermark, by design.

The watermark rule

The watermark is the one place where a small rule prevents a real, recurring mistake. Where it’s allowed, it’s applied the dull, deterministic way: the logo PNG is scaled to a fixed fraction of the frame, dropped into a chosen corner at low opacity — faint enough to deter casual reuse, light enough not to fight the product — and composited over the finished image. Same logo, same corner, same opacity, every time.

The rule that matters is where it isn’t applied. The big marketplaces — Amazon in particular — explicitly forbid watermarks, logos, and promotional text on a product’s main image, and an image that breaks that rule gets the listing suppressed. So the marketplace variant is configured with watermarking off, full stop, and that isn’t a toggle the system is allowed to get wrong: it’s baked into the channel spec, not decided per image. The web and social variants carry the mark; the marketplace one never does. It’s the same kind of guardrail as the rest of the series — the expensive mistake (a suppressed listing) is made structurally impossible, rather than left to whoever’s paying attention that day.

Why keep it deterministic

It would be tempting to let a model “make it look nice” — pick a flattering crop, choose a background, place the logo where it looks best. The cost of that is consistency: a catalogue where every image was composed slightly differently looks amateurish in a grid, and a process you can’t predict is one you can’t trust to run unattended. By making every step here pure arithmetic against a fixed config, the output is uniform across a hundred products and reproducible if you ever change a spec and want to re-run the lot. The model already did the one job only a model can do; this stage is deliberately boring, and boring is what scales.

Design rules for the variants

  • Crop from the alpha, not the frame. The product’s bounding box is the image; the original margins are discarded.
  • One spec per channel, set once. Fill fraction, pixel size, background, and watermark are config, not per-image choices.
  • White when the channel demands white. Marketplace images are flattened onto pure #ffffff; the web store can keep transparency.
  • No watermark on marketplace mains. The rule is structural, so a suppressed listing can’t happen by accident.
  • Deterministic on purpose. Same cutout and config always yield the same set, so a catalogue stays uniform and re-runnable.
All posts