Code-driven illustration
How it works
1) A prompt describes the desired illustration and usually names the target language (e.g. "draw an SVG of..."). 2) The LLM generates source code in a graphics/markup language (SVG, HTML Canvas+JS, CSS, p5.js, TikZ, matplotlib, WebGPU). 3) The code is executed/rendered by the appropriate engine (browser, LaTeX, interpreter), producing the image. 4) Because the result is code, it can be inspected, debugged, parametrized and iteratively refined — the model can fix its own code. A reverse variant (image-to-code / vectorization) also exists, where the model reconstructs an image as SVG code, as in StarVector.
Problem solved
Pixel/diffusion generators produce bitmaps that are hard to edit precisely, do not scale without quality loss, can be heavy, and struggle with exact geometry, text and structured diagrams. Code-driven illustration yields output that is editable, resolution-independent, lightweight and inspectable, with precise control over shapes, coordinates, text and colors.
Strengths & limitations
Evolution
The report showed GPT-4 generating TikZ code (a unicorn), SVG (cat, truck) and JavaScript (Kandinsky-style images, a 3D scene) — popularizing the idea of "drawing with code".
A multimodal LLM that generates SVG code; image-to-SVG, text-to-SVG and diagram generation, working directly in the SVG code space.
A benchmark probing whether LLMs understand the visual output of symbolic graphics programs — ICLR 2025 Spotlight.
The prompt "generate an SVG of a pelican riding a bicycle" became a popular informal test comparing models' ability to draw with code.