transparent product image pipeline: separate generation from alpha preparation
A transparent product image pipeline has two distinct jobs: obtaining a useful product image and producing a verified alpha channel. A white background, a checkerboard pattern, or a PNG filename is not proof of transparency. Build a separate masking stage and inspect the exported pixels before using the asset on a website.
The current Genace image request maps generation parameters to a provider. It does not expose a native transparent-background switch or a guaranteed cutout output. Background removal, edge cleanup, compositing, and alpha validation belong to your own editor or post-processing service.
Preserve the source and the mask
Keep the original generated output or approved product photograph unchanged. Create a separate mask that identifies the intended foreground. Store the source identifier and mask version together so a later correction can be reproduced without generating another candidate.
Start with a reviewable mask rather than chasing a perfect automatic result. Fine hair, transparent plastic, glass, reflective metal, and soft shadows need different handling. A mask suitable for an opaque carton is unlikely to be suitable for a clear bottle.
Inspect on contrasting backgrounds
| Test background | What it reveals | Common repair |
|---|---|---|
| White | Dark edge contamination | Refine boundary colors |
| Black | Pale halos | Remove residual background fringe |
| Saturated color | Missing translucent regions | Rebuild partial alpha |
| Checkerboard | Holes and detached pieces | Correct the foreground mask |
Do not treat the checkerboard test as sufficient by itself. A baked-in checkerboard can look transparent while remaining fully opaque. Test actual compositing over several colors and inspect the alpha channel with your image tool.
Use an explicit export contract
Require the post-processing stage to record pixel dimensions, file format, alpha presence, and mask revision. If a delivery format cannot represent the needed transparency, choose another format or deliberately flatten against a documented background.
For an opaque product with a soft cast shadow, decide whether the shadow belongs in the asset or should be rendered by the page. Keeping the shadow without recording that choice can produce two shadows when the asset is later placed on another surface.
Edges need a final-size check. A cutout can look clean at full resolution but produce halos after reduction. Inspect the exact derivative that will be delivered, not merely the large working image. Resize and export through a controlled post-processing recipe.
Keep product review separate
Masking should not repaint the product into a different item. Compare label boundaries, handles, openings, and small attachments against the approved reference after cleanup. If the source itself invented a structural detail, a better alpha channel does not solve that problem.
Attach the reviewed cutout to your own asset record and store it durably. The generation output URL is a collection location, not a commitment to preserve your final edited derivative.
Acceptance checklist
Confirm actual alpha, inspect four background colors, review fine edges, verify dimensions, and check the delivered crop. Reject baked-in checkerboards and unexpected opaque regions. Keep the original, mask, recipe, and final file linked for later repairs.
Continue with background composites, delivery formats, and version lineage.
Continue with creative workflows
Where these facts come from
- https://imagemagick.org/command-line-options/#alpha
- https://imagemagick.org/command-line-options/#background
- codebase: src/app/api/v1/images/generations/route.ts
- codebase: src/ai/providers/nano-banana.ts
- Application-owned workflow recommendations; human review and post-processing are outside the generation gateway
- Editorial keyword hypothesis; search volume not measured