image format delivery pipeline: choose an encoding from measured exports
An image format delivery pipeline should choose an encoding after inspecting actual exports. A filename alone does not establish the file’s contents, quality, or suitability for a placement. Keep the source master, create measured derivatives, and review the exact bytes your application will serve.
Genace provides image generation outputs. It does not expose a general-purpose delivery transcoding service through the image request body. Format conversion, compression settings, compatibility checks, and hosting are your own post-processing responsibilities.
Classify the image before encoding
Identify whether the image is a photograph, an illustration with sharp edges, a transparent cutout, or a composition containing exact text. Different content can respond differently to the same encoding settings. Do not select one format solely because it was smaller for an unrelated sample.
The MDN image-format guide is a useful reference for format capabilities. Use it alongside real tests in the browsers and delivery surfaces you support.
Create a small comparison set
| Candidate | What to measure | What may fail |
|---|---|---|
| Photographic derivative | Bytes and fine texture | Smearing or block artifacts |
| Sharp-edge illustration | Edge clarity | Color ringing |
| Transparent asset | Alpha and boundary quality | Flattened or haloed edges |
| Text composition | Small lettering | Lost legibility |
| Alternate browser source | Actual load behavior | Unsupported or incorrect delivery |
Keep every candidate at the same dimensions and crop during the comparison. Otherwise a smaller file may simply contain fewer pixels or less visible content rather than a more suitable encoding.
Convert outside the generation step
With ImageMagick available, this example creates one trial WebP derivative from a local master. Treat the quality value as an experiment to review, not a universal recommendation.
magick approved-master.png -quality 85 trial.webp
magick identify trial.webp
Inspect the generated file in an image viewer and in the actual page. Record the measured dimensions, bytes, encoding recipe, and reviewer decision. If the input needs transparency, verify that the chosen output preserves the intended alpha rather than assuming conversion did so.
Do not change only the extension of a file. A delivery system should use the actual encoded media type and a matching content-type response, with a fallback strategy when your supported environment requires it.
Keep the master and publication mapping
Store each encoded file as a derivative of the reviewed source. If the format choice changes later, you should be able to create another export without regenerating the image or losing the previous approval evidence.
A page using several format candidates should still map them to the same intended composition. Avoid accidentally supplying a different creative as a fallback under the assumption that it is merely another encoding.
Acceptance checklist
Compare equal-size exports, inspect fine edges and exact text, verify alpha when relevant, and test loading in supported environments. Confirm actual media type, byte size, and the destination mapping. Publish the selected derivative while retaining the master and rejected trials for reproducibility.
See responsive derivatives, transparent assets, and file-size budgets.
Continue with media delivery
Where these facts come from
- codebase: src/ai/providers/types.ts
- codebase: src/ai/jobs/http.ts
- https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Image_types
- https://imagemagick.org/command-line-options/#quality
- Application-owned workflow recommendations; human review and post-processing are outside the generation gateway
- Editorial keyword hypothesis; search volume not measured