Image LLMs do not deliver true RGB 255/255/255 backgrounds, no matter what the prompt says. Apiway's White Studio template does — via a four-stage post-processing pipeline that runs after the LLM has finished its job. Here is the technical walkthrough, including the failure modes we ran into building it.
Why the LLM cannot do this alone
Diffusion models reproduce statistical patterns from training data. Real product backdrops in photographic training data are almost never literally pure white — cyclorama walls reflect at ~95% albedo, seamless paper picks up gradients, sensor noise lifts the floor pixel by a few digital values. The model has learned that “white background” means slightly textured off-white. (More: why your prompt for pure white still gives grey.)
Asking the model to deliver true #FFFFFF is fighting the training distribution. The right move is to let the model produce its best image and then enforce the background colour deterministically in a post-pass.
Stage 1: subject segmentation with shadow preservation
Identify the foreground (model + garment) as one mask, the cast shadow under the feet as a separate soft mask, and the background as the rest. Three layers, not two.
The shadow mask is the layer most pipelines miss. Without it, the recomposite drops the floor contact and the model looks like she is floating — which is worse than a slightly grey background, because shoppers register the floating instantly. With it, the model stays grounded.
We use a custom-trained segmentation model that specifically handles fashion-photography edge cases: hair against the background, drapey fabric edges, accessories like belts and bags whose silhouette is non-trivial.
Stage 2: recomposite onto literal #FFFFFF
Generate a new canvas at the target aspect ratio (1:1, 4:5, 9:16, etc.), filled with literal RGB 255/255/255. Place the foreground subject mask on top. Place the soft shadow mask over the white canvas at reduced opacity (typically 15–35% depending on the original image).
At this stage the corner pixel is genuinely #FFFFFF. The Amazon-policy compliance question is solved.
Stage 3: alpha matting at the edges
Hard-cutout edges look unmistakably composited. Hair especially — a clean polygon edge through hair reads as fake instantly. The pipeline runs a learned alpha-matting pass that softens edges, lets fine hair strands feather into the white background, and preserves fabric edge texture.
This is the stage that took the longest to get right. Early versions either over-feathered (hair bleeding into the background) or under-feathered (hard polygon edges). The production version walks the line by sampling the original edge softness from the LLM output and matching it on the new canvas.
Stage 4: tone correction across the foreground
Once the foreground is on a fresh #FFFFFF canvas, the original LLM-generated lighting can look slightly off relative to the new background. The model was lit for an off-white original; the white canvas is brighter, and the contrast can read harsh.
A small global tone-correction pass rebalances the foreground to look like it was always shot on this background. Subtle — usually a 2–5 percent adjustment to the foreground luminance, plus a tiny white-balance shift if the original was lit warm.
Failure modes we hit building it
- Floating models: early versions dropped the shadow mask. Fixed by tracking the cast shadow as a separate layer through the pipeline.
- Halo edges: a thin off-colour ring around the foreground when the segmentation grabbed a one-pixel border of the original background. Fixed by shrinking the foreground mask by 1–2 pixels and using alpha-matting at the boundary.
- Hair fragmentation: fine hair strands getting cut into a polygonal silhouette. Fixed by the alpha-matting pass in stage 3.
- Accessory occlusion: belts, bag straps, jewelry chains being miscategorised as background. Fixed by training the segmentation model on fashion-specific data with these classes labelled.
Performance and cost shape
End-to-end the pipeline runs in roughly 1.5–3 seconds per image on production GPU infrastructure. Cost is absorbed into the per-shot credit price; the user does not see the pipeline as a separate line item. (Pricing recap: one credit equals one cent.)
Why this is a real product edge
Most fashion AI tools either skip the pipeline (and ship slightly-grey output that fails Amazon's rule) or offload the white-background work to the user (manual Photoshop pass per image). Apiway makes it the default for White Studio. The deliverable is policy-compliant the moment it leaves the template.
Test the corner pixel yourself
Generate one image in White Studio. Sample the corner pixel in any image editor. Verify it reads RGB 255/255/255. Free accounts ship with 100 one-time credits — enough to verify and stress-test on real garment files.
