I did not need 33 different ideas for this article. I needed four: a hero, a pipeline, a mobile comparison, and a quality-control story. The rest was production work.
That distinction changed how I make images for this site. The useful creative decision is the concept and its hierarchy. Repeating exports, formats, widths, dimensions, and social crops is mechanical. I moved that work into code, then kept the final visual judgment outside it.
Four concepts, 33 files
Each concept has two authored compositions: a 1600 × 900 landscape master and a 900 × 1200 portrait master. The portrait is not a crop. It preserves the same information with a different reading order and larger labels.
The static build expands those eight PNG masters into the delivery set:
8 authored PNG masters
8 full-resolution WebP files
16 responsive-width WebP files
1 Open Graph JPEG
--
33 production files
Calling these 33 individually designed images would be misleading. There are eight deliberate compositions and 25 derivatives. The value of the workflow is that the derivatives follow the masters without becoming 25 additional editing tasks.
Two stages, not one magic command
The workflow has an intentional pause:
generate masters -> inspect and correct -> build delivery assets
The generator encodes the house colors, type choices, facts, and coordinates in SVG, then Sharp renders the PNG masters. The static build reads those files, creates WebP versions and width candidates, makes this site's 1200 × 630 social crop, adds intrinsic dimensions, and writes the final <picture> markup.
The hero is a text-free still. Its source bitmap is not published directly, so the 33-file count covers the delivery set readers and social previews can actually receive.
That is repeatable inside this project environment, not a promise of identical pixels on every computer. Font files, Sharp, libvips, and SVG renderers can change raster output across machines. The source and build configuration make the process inspectable and repeatable here; they do not make the rendering stack universal.
Mobile needed a new composition
My first assumption was that responsive delivery meant smaller files. That only solves part of the problem. A landscape diagram reduced to a phone width can remain technically complete while its labels become useless. Cropping it can remove the evidence entirely.
The HTML standard calls the alternative art direction: selecting different image content for different presentation conditions. The mobile masters keep every fact, but stack the hierarchy vertically. The browser can then choose an appropriate width from each composition's own srcset.
Researching this article exposed two gaps in my first implementation. The portrait <source> elements did not declare their own dimensions, so the browser could initially reserve the landscape ratio. The build also generated small WebP variants for the art-directed images without referencing them in the final HTML. I corrected both: every portrait source now carries its real width and height, and each WebP source receives its own width candidates without losing its media query or fallback.
Explicit dimensions let the browser reserve space before an image loads, which helps prevent layout movement. The web.dev guidance on layout shift covers the same requirement for sources with different aspect ratios. Google also recommends retaining the <img src> fallback when using responsive image markup because not every crawler or browser processes the advanced attributes in the same way (Google Image SEO guidance).
The tests passed. The cards still touched.
The image tests can verify file count, format, dimensions, and whether every referenced asset exists. They cannot decide that a composition looks balanced.
The previous article made that limit obvious. A long “Image Editing” card was 250 pixels wide inside columns separated by 245 pixels. The generated PNG was valid and every test passed, but the card overlapped its neighbor by five pixels. “Screen Recording” also crowded the consolidation arrow. Visual review caught both. Reducing the long-card width to 225 pixels created a 20-pixel column gap and cleared the arrow; regenerating the family applied the correction consistently.
The same review caught a more serious factual error earlier: one image said the generated site fell to 10 pages when the verified count was 9. A flawless export would only have reproduced the wrong number more reliably.
Two of the eight masters are the weight
I counted images/posts/coded-image-workflow/ on 16 November 2026. The inventory above is still exact: 8 PNG masters, 8 full-size WebP siblings, 16 width-capped WebP files, and one og.jpg. The file count is a poor description of the bytes.
| Master | PNG bytes | WebP bytes | WebP / PNG |
|---|---|---|---|
| hero | 2,742,519 | 95,388 | 3.5% |
| hero, portrait | 1,868,606 | 54,054 | 2.9% |
| pipeline | 141,148 | 48,714 | 34.5% |
| pipeline, portrait | 106,528 | 33,758 | 31.7% |
| art direction | 125,592 | 35,674 | 28.4% |
| art direction, portrait | 96,897 | 32,160 | 33.2% |
| spacing correction | 108,178 | 38,176 | 35.3% |
| spacing correction, portrait | 100,520 | 37,310 | 37.1% |
The two hero PNGs are 4,611,125 bytes. The six diagram PNGs are 678,863. Of the 5,289,988 PNG bytes in the folder, 87.2% is the pair of photographs and 12.8% is every diagram. Sharp 0.34.5 at quality 80, which is the call in generateWebpVariants, turns the heroes into 149,442 bytes (3.2% of their PNG size) and the diagrams into 225,792 bytes (33.3%). The eight full WebP files together are 375,234 bytes, 7.1% of the PNG set.
The width variants add 456,158 bytes. The Open Graph JPEG is 127,721 bytes, a 1200 × 630 cover crop of the light hero at JPEG quality 85, which is the setting in generateOgImages. It is one more derivative of the heavy photograph, not a ninth composition. The directory is 6,249,101 bytes. A reader downloads one candidate from a srcset, not the directory. The 33-file figure is the production checklist. It is not the page weight.
I split heroes from diagrams by filename, -hero against the three diagram stems, and then added the bytes. I did not sort the files by looking at them. The hero source is a still and the diagrams are SVG rendered through sharp, which is how this folder is built. The ratios are consistent with that split. A diagram PNG is already a cheap file, so WebP removes less of it. A photographic PNG is not. That sentence is my reading of the table, not a second measurement.
Portrait masters are 900 pixels wide, so the build's 480, 960, and 1440 widths keep only the 480w file. It does not upscale. The 1600-pixel landscape masters keep all three. That is 4 portrait variants and 12 landscape variants, 16 files, which matches the directory listing and the count in the first section.
I re-encoded the eight PNGs with sharp(src).webp({ quality: 80 }) on Node v22.23.4. The first pass took 688 ms and matched each committed WebP on length. I did not hash that pass. The second took 756.4 ms, and each buffer was byte-for-byte equal to the committed file. I compared SHA-256 hashes, not just sizes. The files in git are what this sharp writes at quality 80. Two timings on one machine are not a benchmark. They show the encode is under a second here, and that the second run reproduced the committed bytes.
The ratio holds past this article. I dropped images/posts/claude-watermark-without-detector/, a directory with no entry in ALL_POSTS, and counted the rest: 125 PNG masters, 63,091,735 PNG bytes, 4,547,394 bytes of full-size WebP, which is 7.2%. This folder is not a special case. The PNG column is mostly photographs. The WebP step is where the delivery size moves.
A byte count still cannot see the five-pixel overlap from the previous section. That miss was about meaning. This one is about weight, and the weight says the automation is doing the part with an objective contract.
What stays automated
I will keep automating the parts with objective contracts: dimensions, encodings, width variants, file references, metadata, and the social crop. I will keep inspecting the parts that depend on meaning: facts, hierarchy, spacing, legibility, and whether the image earns its place in the article.
That is a smaller promise than complete automation, and a more useful one. Code makes a correction cheap to propagate. It does not decide that the correction is good.
