Code-Driven AI Illustrations: Editable SVG, Canvas & WebGPU Agent Pipelines

Simon Willison’s November 28, 2026 analysis demonstrates why frontier coding LLMs (Claude Opus 5.5, GPT-6 Astra, Gemini 4 Neon) generating SVG, HTML/CSS, 2D Canvas, Blender scripts, and WebGPU shaders outperform bitmap image models for technical diagrams, posters, UI components, and game assets. Code-driven outputs guarantee crisp font typography, editable DOM/vector layers, and surgical iterative fixes.
Code-Driven AI Illustrations: Editable SVG, Canvas & WebGPU Agent Pipelines: Simon Willison’s November 28, 2026 analysis demonstrates why frontier coding LLMs (Claude Opus 5.5, GPT-6 Astra, Gemini 4 Neon) generating SVG, HTML/CSS, 2D Canvas, Blender scripts, and WebGPU shaders outperform bitmap image models for technical diagrams, posters, UI components, and game assets. Code-driven outputs guarantee crisp font typography, editable DOM/vector layers, and surgical iterative fixes. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 100% Editable Vector Layers: Open generated SVGs directly in Inkscape, Adobe Illustrator, or Boxy SVG to tweak text strings, colors, or individual bezier paths.
- Guaranteed Font Typography: Eliminates garbled bitmap lettering and zoom artifacts common in diffusion or multimodal image generators.
- Closed-Loop Render Verification: Pair an SVG generator with headless Chromium or resvg inside Smoke Monkey Harness so the agent inspects PNG renders for pill/label overflow.
- Full Stack Graphic Formats: Extend the same coding-agent pattern to HTML/CSS decks, 2D Canvas visualizations, Blender Python scripts, WebGPU shaders, and PDFs.
import { createAgent } from '@smoke-monkey/harness';// Coding agent that authors SVG diagrams and verifies layout via headless rasterizationconst agent = createAgent({agentId: 'code-driven-svg-illustrator',provider: 'anthropic',model: 'claude-opus-5-5',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function main() {const result = await agent.run(['Create docs/architecture-diagram.svg (1200x675 viewBox, crisp system fonts, <g> labeled layers).','Render it to /tmp/preview.png using resvg or rsvg-convert so zero text labels overflow pill containers.',].join(' '));console.log('Generated and verified SVG illustration:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
Top 6 Tools to Turn Code into Beautiful Diagrams
AI Diagrams Are Ugly. This Free Skill Fixes Them
Why Code-Driven Illustrations Outperform Bitmap Models for Engineering Assets
Dedicated image models—ranging from diffusion pipelines to LLM-driven bitmap editors like Nano Banana, ChatGPT Images, and Ideogram 4.0—bake pixels into a flat raster array. Even when multimodal editors preserve details across turns, zooming in exposes micro-glitches, distorted glyphs, and locked layers that cannot be edited independently.
When a frontier coding model (Claude Opus 5.5, GPT-6 Astra, or Gemini 4 Neon) writes SVG, HTML/CSS, 2D Canvas, Blender Python, or WebGPU shaders directly inside an agent harness, every visual primitive remains inspectable source code. Fixing a clipped pill badge takes a two-character width attribute edit rather than re-rolling an entire diffusion seed.
| Criterion | Code-Driven Agent (SVG / Canvas / Blender) | Dedicated Bitmap Image Model |
|---|---|---|
| Output Representation | Inspectable XML / DOM / Python / WGSL source | Flat raster pixel grid (PNG / WebP) |
| Typography Fidelity | Native font rendering, crisp at any zoom | Approximated pixel glyphs; occasional artifacts |
| Element-Level Editing | Direct edit in code, Inkscape, Illustrator, Boxy SVG | Requires inpainting or full re-generation |
| Best Fit Use Cases | Architecture diagrams, posters, UI, charts, game sprites | Photorealistic scenes and organic photography |
Fixing Blind Spots: Pairing SVG Codegen with Local Raster Inspection
As Simon Willison documented when iterating on a 1970s-styled Kakapo conservation poster with Gemini 4 Neon, chat interfaces that do not render SVGs force the user to screenshot clipping bugs (such as text overflowing a pill box) manually.
In a local agent harness, you eliminate that manual copy-paste loop:
- Structured Layer Groups: Prompt the agent to wrap semantic components in named
<g id="...">groups with explicitviewBoxcoordinates and web-safe or embedded font stacks. - Automated Raster Check: Run
resvgor Playwright in a verify step to produce a PNG preview, then let the multimodal model inspect its own render for bounding-box collisions before marking the task complete. - Domain Fact Grounding: Have the agent fetch or search verified statistics first so embedded numbers, labels, and captions are factually accurate.
Beyond SVG: Vibe Game Assets & Presentations
The same code-driven loop applies to slide decks (HTML/CSS + PDF export), 3D props (Blender Python), and procedural WebGPU textures—all version-controlled in Git alongside application code.
Reproducible SVG Validation & Raster Verification Pipeline
Add a deterministic CLI check to validate XML well-formedness and render a verification PNG on every SVG generated by your agents:
# 1. Validate XML syntax of generated SVG files
python3 -c "import xml.etree.ElementTree as ET; ET.parse('docs/architecture-diagram.svg'); print('Valid SVG XML')"
# 2. Rasterize SVG at 2x scale using resvg (or rsvg-convert) for visual inspection
resvg docs/architecture-diagram.svg /tmp/architecture-diagram.png --width 2400
# 3. Inspect dimensions and file size
file /tmp/architecture-diagram.pngRun this workflow inside Smoke Monkey Harness to turn text-only coding agents into deterministic visual asset generators without external bitmap APIs.
Frequently Asked Questions
Q:When should I use code-driven AI illustrations instead of a bitmap image model?
Use code-driven generation (SVG, HTML/CSS, Canvas, Blender, WebGPU) for technical diagrams, UI mockups, posters with exact typography, data visualizations, presentations, and modular game assets. Use dedicated image models for photorealism.
Q:Why did Claude and other text LLMs close the gap without native bitmap generators?
Frontier text LLMs became skilled enough at spatial layout, CSS, and SVG geometry that they can build complete presentations, websites, and vector posters purely through code—another manifestation of the bitter lesson.
Q:How do I stop LLMs from overflowing text boxes in generated SVGs?
Give the agent a shell tool that rasterizes the SVG via resvg or headless Chromium so it can visually inspect bounding boxes and adjust rect widths or font sizes automatically.
Q:Which tools can edit AI-generated SVG files afterward?
Any vector editor—including Inkscape, Adobe Illustrator, Figma, and Boxy SVG—or a plain text editor can modify individual shapes, colors, and text nodes cleanly.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.