Code-driven illustrations vs image models: which fits your article diagrams?
Turn your idea into a professional visual — free credits on sign-up Create my first visual
When it's time to illustrate an article, many teams reach for a text-to-image model by default. But for an explanatory diagram, an editable poster or a UI component, another route is often more useful: ask a large language model to write code (SVG, HTML/CSS, Canvas) that renders the image. Simon Willison makes this case in a post published in late 2026, drawing on his own experience rather than a comparative study. Here's what to take away, and how to apply it.
The problem with a "flat" image
A classic image model — Stable Diffusion, DALL-E, Midjourney, and newer generations like Nano Banana or ChatGPT Images — produces a bitmap file. Willison notes that recent models edit images better and preserve more detail from one turn to the next. But he flags three persistent limits: glitches visible when you zoom in, text that isn't guaranteed to use a real font, and no manipulable layers. To fix one detail, you regenerate and hope the rest stays put.
An image defined by code behaves differently: it stays editable. You can change a color, move a label or correct a number without starting over.
What a code-generated illustration can do
According to Willison, a model connected to a coding agent can produce far more than an SVG: image files, HTML/CSS, Canvas, Blender scripts, WebGPU shaders or PDFs. He cites Claude Opus 5.5, GPT-6 Astra and Gemini 4 Neon as capable of creating game assets through code. He also states that Claude now produces presentations and web designs, and that Claude Design relies on code-generated images.
These observations come from the author, without detailed independent testing: treat them as usage reports, not a benchmark.
A concrete example: the kakapo poster
Willison describes asking Gemini 4 Neon for an SVG poster about kakapo conservation, in a 1970s graphic style. Two points stand out:
- The tool doesn't always show the result. AI Studio doesn't display SVGs, which prevents the model from spotting visual errors on its own. You have to describe what's wrong.
- Fixing happens through targeted iterations. The author had the face realism adjusted and text that overflowed a shape corrected.
The figures on the poster came from Google searches and were verified as correct by the author. That's a personal check, not reproduced in the source: keep the habit of verifying any factual data.
The final SVG remains editable directly or in Inkscape, Adobe Illustrator or Boxy SVG — a clear advantage for an editorial team that needs to touch up a figure before publishing.
How to ask Claude or ChatGPT
The source offers no reproducible method. Still, a cautious approach consistent with the described example is possible:
- Specify the expected format: standalone SVG, HTML/CSS, Canvas. Give dimensions and require the file to open on its own.
- Describe content and style: subject, elements to represent, palette, visual reference (here, the 1970s).
- Ask for a visible render if the tool allows it; otherwise, paste the code into an SVG viewer and describe the flaws to the model.
- Iterate with small fixes rather than full rewrites.
- Verify the facts shown in the image separately.
This procedure is a reasonable reading of the example, not a recipe validated by the source.
When to prefer generative images
Willison stays balanced: he considers dedicated image models still preferable for photorealistic generation. He also mentions that Ideogram 4.0 claims layout control through bounding boxes via structured JSON — a lead for those who want bitmap with some control.
| Need | Code (SVG/HTML) | Image model |
|---|---|---|
| Explanatory diagram | Suitable | Less suitable |
| Editable poster | Suitable | Limited (no layers) |
| UI component | Suitable | Poorly suited |
| Data visualization | Suitable | Poorly suited |
| Game asset | Suitable | Variable |
| Realistic photo | No | Preferable |
This table summarizes the author's judgment based on his use cases; it does not rest on a comparative study.
Key takeaways
- For a diagram, poster or component, generated code offers editability that bitmap lacks.
- Plan for a correction loop: the model doesn't always see its own render.
- Verify numbers and facts embedded in the image separately.
- Keep the image model for photorealism.
- The cited capabilities (Gemini 4 Neon, Claude Opus 5.5, GPT-6 Astra) are reported by the author; the source itself acknowledges its overview may be incomplete.
Roboto, a platform for generating texts, images, videos and voiceovers with AI, publishes this article; it performed no testing on the tools mentioned.
Source
Code-driven AI illustrations are more useful than images from image models