[KongchangAI]
· 2 min read· 1,040 words

Code-Generated Images More Practical Than Dedicated Graphics Models?

Code-Generated Images More Practical Than Dedicated Graphics Models?

LLMs generate editable images by writing code, rewriting design workflows.

The article notes that frontier LLMs are expanding from pure text output into visual design by generating code rather than directly outputting pixels. Using SVG posters as an example, models can supplement data via search and iterate over multiple rounds, with every element precisely editable in editors. This paradigm extends to HTML/CSS, Canvas, Blender scripts, shaders, etc., fueling the explosion of vibe game development. Dedicated image models still have advantages in photorealism and image editing, but suffer from zoom glitches, inconsistent text typography, and inability to manipulate independent layers. The author sees this as a variant of the "bitter lesson": general LLMs keep getting stronger, ultimately covering some scenarios of dedicated image models by writing code. The core value of code-driven images lies in editability, iterability, and reusability.

When LLMs Learn to "Write" Images, Design Workflows Are Being Rewritten

A notable trend is that frontier large language models are rapidly improving in visual reasoning and creative design. If you ask these text-output models to generate a 2D image, the results are not only usable—they're sometimes quite beautiful. More importantly, these images are defined by code—meaning you can directly modify the code to adjust the design, rather than enduring the "gacha-style" trial-and-error of text-to-image models.

Code-driven AI illustration example

The Value of "Editability" Through an SVG Poster

Simon Willison ran a real test with Gemini 4 Neon: asking the model to generate an SVG poster promoting a kakapo conservation project, in a 1970s graphic design style. The process required multiple rounds of iteration—AI Studio itself doesn't render SVG, so the model couldn't independently spot visual errors and needed a human to point out issues like text overflow and graphic proportions.

The final product was quite solid: the model found statistics such as population numbers via Google Search and correctly annotated them in the design. But what really matters isn't whether the poster looks good—it's that every element can be directly edited—you can change the text in the SVG, or visually adjust it in Inkscape, Adobe Illustrator, or Boxy SVG.

SVG (Scalable Vector Graphics) is an XML-based text format that describes graphic elements (paths, circles, text, gradients, etc.) with tags rather than recording pixels. Therefore, an SVG file itself is readable, editable source code: text is a real text node, shapes are defined by mathematical paths, and scaling doesn't cause distortion. Browsers, Illustrator, Inkscape, and other tools can directly parse and visually edit it. For LLMs, this means generating a poster is equivalent to generating a piece of structured code—the model can precisely specify each element's coordinates, colors, and font sizes, and humans can modify at the same level without rebuilding pixels like with bitmaps. This also explains why SVG is an ideal vehicle for testing the concept of "code as image."

Beyond SVG: Code as Image Generator

SVG is just one form. Models connected to coding agent environments can execute code to generate images, opening up an entire space of possibilities: image files, HTML/CSS, Canvas elements, Blender scripts, WebGPU shaders, PDFs—any image mechanism that can be represented as a disk file or script output can become the model's target.

This may also explain why vibe game development has exploded recently: models like Claude Opus 5.5, GPT-6 Astra, and Gemini 4 Neon are fully capable of producing game assets of adequate quality—3D models, textures, sprites—by writing code. Building with code means adjusting, reusing, and remixing all just require asking the model to write more code.

"Coding agent environment" refers to an environment where the model can not only output code but also execute it in a sandbox, read the results, and self-correct based on errors or output (e.g., an agent with file system and terminal access). In such an environment, the model writes a Python script calling Pillow or matplotlib to render an image, runs a WebGPU shader to produce a frame, or executes Blender's Python API to generate a 3D scene, then views the generated image file and iterates. The key difference from pure text completion is the "execute—observe—correct" loop, enabling the model to autonomously discover and fix rendering-level issues without relying entirely on humans pointing out errors.

Where Are the Boundaries of Dedicated Image Models?

Most AI image generation tools use models that directly output bitmaps. Over the past year or so, LLM-driven variants like Google's Nano Banana and OpenAI's ChatGPT Images have become quite capable at editing existing images and preserving details, and multi-turn conversational iteration doesn't easily break down.

But they still have limitations: zooming into details produces strange glitches; text shapes are output directly by the model, without the consistency guarantees of a real font typography system; and they are essentially flat—you can describe modifications in text or annotate on the image what you want, but you cannot grab an individual element or layer and manipulate it directly.

Code-generated images solve all of these problems. Of course, if you want photorealistic images, dedicated image models still have their place. But for explanatory diagrams, editable poster design, UI components, visualizations, and game assets, code-driven images are the better choice.

Text-to-image models are typically based on diffusion models, generating bitmaps by progressively denoising at the pixel or latent space level. Bitmaps are flat pixel grids with no semantic layering: "text" in the image is just pixels drawn in the shape of text, not font objects controllable by a typography engine, so glyph details, kerning, and consistency are hard to guarantee; there is also no concept of "layers" or "elements" on the canvas, so you cannot select an independent object to move or recolor it individually. Code-driven images, by contrast, are built on vectors or scene graphs, where elements have identity and properties, and modifications are precise and deterministic. The difference in underlying representation is precisely the root of the "editability" gap.

A Variant of the "Bitter Lesson"

The author admits that after Nano Banana and ChatGPT Images appeared, he once believed Anthropic faced a serious product gap—OpenAI and Google both had excellent image generation models, even video generation models, while the business world still runs on PowerPoint, and enterprise customers would likely treat image generation as a standard feature.

But now Claude can produce visually appealing presentations and website designs quite smoothly, and Claude Design also provides a complete design system platform—all built around code-driven images.

This is like another variant of the "bitter lesson": the author was once convinced that serving clients with design needs required dedicated image models, but text-output LLMs kept getting stronger until they could handle visual design by writing code.

What It Means for Creators

The core advantages of code-driven images can be summarized in three points: editability—every element can be precisely controlled; iterability—modifications are deterministic and don't rely on re-rolling; reusability—code assets are naturally suited for version management and further processing.

For scenarios requiring precise control over design details, this paradigm shift deserves serious attention. Dedicated image models won't disappear, but "drawing with code" is becoming the preferred path for more and more design tasks.

#code-driven images#LLM image generation#SVG poster#text-to-image models#vibe game development#editable design
Share:

Related articles