AI illustrations in SVG: the win is that you can check them
6m read time

AI illustrations in SVG: the win is that you can check them

Simon Willison argues that illustrations a model draws in code are more useful than images from a dedicated image model, because you can edit them. A model has drawn the SVG illustrations on this blog since September. The bigger win turned out to be something else: an SVG is a file, and a file can be checked before anyone looks at it.

Simon Willison wrote on Saturday that illustrations a language model draws in code are more useful than images from a dedicated image model. His example is an SVG poster for the kakapo recovery project, made with Gemini 4 Neon. It took a few rounds. One of his follow-up prompts:

The text here doesn't fit the pill, fix it

I know that bug. The first draft of the very first drawing on this blog, the baseline in the quality ratchets post, had labels that came out six pixels tall on a phone. Perfectly legible, provided you keep a magnifying glass next to your phone.

Willison is right. I just find the win somewhere other than where he puts it.

Where Willison is right ​

His main argument is editability: "everything is editable." An SVG is text. You change a label in your editor, or open the file in Inkscape. He grants that image models have become competent at editing across several turns, but what comes back is still a new picture.

He also lists what they do badly. They produce "weird glitches" you only see when you zoom in. They draw text as shapes with no typeface behind them. And the result is flat, so you cannot move a single element. An update under his post softens that last point a little, since Ideogram 4.0 claims bounding-box layout control.

What he does not mention, I see every time: a picture from an image model looks like every other picture from an image model. Ask a model an open question and it keeps landing on the same few answers. A robot holding a magnifying glass fits every post about AI code review, and there are plenty of those by now. A drawing of the mechanism in a post only fits that post.

Willison leaves photorealism to the image models. For explanatory diagrams, posters, UI components, visualisations and game assets, he calls code "a better bet". I agree.

What editability leaves out ​

From prompt through SVG, validator and PNG to approval, with two ways back to the SVG.

Editing happens afterwards, once you have already seen the mistake. The more useful property of an SVG is that you can catch the mistake before anyone looks.

Every drawing on this blog goes through scripts/illustrate.mjs before I see it. The script rejects:

  • a colour outside the palette. Eleven hex values, the colours of the theme and the OG images. A drawing is the easiest place to drift from the palette without noticing.
  • anything external. No <script>, no <image>, no external href, no url(). An SVG that fetches a font looks fine on my screen and wrong on yours.
  • anything over 16 KB.
  • text that does not fit. A monospace glyph is 0.6 times the font size wide, so a label's width is arithmetic: characters times 0.6 times the size. If that leaves less than 8 units to the edge of its box, or two labels on one line sit too close, the draft fails.

That last rule is the kakapo bug, fixed before it exists. Willison had to see that the text did not fit the pill and ask the model to repair it. Here a script does the sum, and nobody has to spot it.

The remaining rules live in the skill the model reads before it draws. Twelve pieces of text at most, and no sentences. No metaphors: no robots, no padlocks, no lightbulbs.

Every word has to read the same in Dutch and English, because one file serves both posts. On 6 September three drafts went in the bin because they had English sentences inside the boxes. Usable in the English post, useless in the Dutch one.

You cannot lint a pixel. You can lint a file.

The model cannot see what it drew ​

Willison names a limit himself. AI Studio does not render SVG, "so the models there can't spot visual mistakes without assistance." He had to look and report back.

It is the same here, which is why illustrate.mjs preview renders the SVG to a PNG in a real browser, on the site's background colour. Then I look at the post in the dev server at 390 and at 1280 pixels wide. A drawing 1200 units wide ends up around 330 pixels wide in an article on a phone. That is how the six pixels turned up.

Then I decide. A drawing I have not seen does not go into a post. A script checks whether the drawing is correct. Whether it explains anything, only someone who has read the post can tell.

What I left on the table ​

The drawings on this blog are simple: boxes, arrows, a bar, a line. That is mostly deliberate. One accent colour, a handful of technical terms, and anything that does not explain gets cut.

But I also started late. Drawing has been part of the writing step since 2 September. Of the 102 posts before that, only 7 got a drawing afterwards. Of the 39 posts since, this one included, 35 have one.

Simple does not have to be the ceiling either. So for this post I dropped the house rules: nothing has to explain anything, metaphors are allowed, and all eleven colours are in play. What stays is the same pipeline: an SVG, nothing outside the palette, through the same validator.

A rainy cyberpunk skyline at night with a striped sun, lit windows and a green neon sign that reads svg.

A skyline in the rain, 7.3 KB. Every window, every raindrop and every stripe through the sun is a line in the file. The model wrote a script that places the buildings, and the validator rejected the first version because a façade ran straight through the neon sign. The validator has no feel for atmosphere.

An isometric server room: two rows of racks with blinking LEDs, a lit aisle and overhead cable trays.

A server room in isometric perspective, 9.8 KB. The first version was 19.2 KB and failed the 16 KB limit. With an image model that would be a compression problem. Here it meant fewer LEDs and coordinates without decimals.

Yes, for a post about validators I sat counting raindrops. There are 150.

Neither explains anything, so neither would make it into a normal post. But the drawing step has been able to do this since September, and I used a fraction of it.

Doing it yourself ​

Any script will do. You need three things:

  1. A validator that fails. Start with your palette, a byte limit and a ban on anything external. Text width is one extra rule once you use a monospace font.
  2. A render step. A headless browser that turns it into a PNG at the width your reader sees. The model cannot see its own work. You can, but only at the size that matters.
  3. An approval. Nothing goes live that nobody has seen. It is the same choice as a hook instead of a polite request: what has to happen, you enforce.

The kakapo poster came out well in the end, and Willison had checked every number on it. It just took a few rounds of looking, spotting and asking. The looking stays. Working out whether the text fits the pill is a job nobody has to do any more.

(44 of 44)
1You don't have an AI problem. You have a process problem.2Why you should never ship code you don't understand3Stop copy-paste engineering4The lava layer: why AI code is slowly petrifying your codebase5The brilliant parrot problem: what AI actually does when it 'thinks'6The prompt is not the spec7The bureaucracy of bots: why we are checking the checker8The day Claude deleted my production database9The arms race for your trust: Mythos, Cyber and the security hype10Stop letting your agents write Markdown11Your agent's suffering is your technical debt speaking12You can't spot the bug if you didn't write the code13One in four: the security debt nobody's counting14Your 10x developer is gated by a 0.1x pipeline15Benchmarks said frontier. Developers said "dumb."16Caveman vs context-mode: small mouth, or smaller room?17Code churn is the lava you can still measure18The ceiling is made of concrete19The token-saver tax: walking back my Caveman advice20Even the malware is AI slop now21ThePrimeagen was right22Tokenmaxxing is what happens when you measure the wrong thing23They just asked the bot nicely: your support agent is the attack surface24Speed got cheap. Judgement didn't.25Your coding agent has no world model. You built it one.26The Ferrari has a limiter: a day with Claude Fable 527The off-switch was never yours28An open MCP server is worse than an open database29The most resilient job is eating its seed corn30The off-switch works both ways now31AI writes the tests. Mutation testing checks if they work.32How to get better at reading code: a practice routine33Learning to program in the age of AI: what I would learn first34Who is responsible for AI-generated code? You are, and 2026 wrote it down35When not to use AI for coding: the tasks I still do by hand36Hiring junior developers in 2026: the collapse is a hiring decision37Software estimation with AI: the typing was never the estimate38Slopsquatting: checking that the package exists is not a defence39Eight reports, one bar: judging an AI safety sprint40Nobody's agent went rogue41The price cut was never a discount42Why AI gives everyone the same name: 505 runs across 19 models43Who owns AI-generated code? Mostly nobody, until you change it44AI illustrations in SVG: the win is that you can check them