arXiv:2610.19025cs.CVOct 2026

Manuscript Offprint

arXiv:2610.19025

How Far Can Coding Agents Go in Visual Generation?

Hengguang Zhou, Yuanhao Ban, Jiaqi Feng, Xiaohuan Pei, Justin Cui, Cho-Jui Hsieh

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Hengguang Zhou 1∗^{1*} Yuanhao Ban 1∗^{1*} Jiaqi Feng 2^{2}

Xiaohuan Pei 1^{1} Justin Cui 1^{1} Cho-Jui Hsieh 1^{1}

1^{1}University of California, Los Angeles 2^{2}Tsinghua University

Figure

Internal imagery z

Independent pixel probes

DhD_{h}

Harness h

Figure

Canvas 2D

Shapes

Pixel harness

Figure

GUI

Figure

Stroke

Figure

Oil brush

Blender

Figure 1. A conceptual view of shared internal imagery across drawing harnesses. Left: the Mona Lisa assembled from 65,536 independent fresh-session pixel queries on a 256×256256 \times 256 grid, used as a behavioral probe of hypothesized internal imagery z. Right: one-shot 256×256256 \times 256 whole-image outputs through seven drawing harnesses, generated without visual feedback. The mapping Ih=Dh(z)I_h = D_h(z) illustrates the hypothesis; the arrow denotes a conceptual relation rather than an experimental image-to-image pipeline.

Abstract

Modern image generation largely relies on specialized generative models that leave the process of image construction implicit in learned parameters. We explore an alternative: general-purpose coding agents that construct images through executable programs. Our study of zero-shot drawing on AgentDrawBench, a 200-prompt benchmark, reveals a distinctive capability profile. Agents excel at preserving structure and satisfying precise visual constraints, achieving competitive results in domains where compositional accuracy matters more than photorealistic appearance, while remaining limited in perceptual richness. Their visual expressiveness varies with the drawing interface, and a qualitative study on reconstruction shows how procedural skills extracted from human demonstrations support different artistic media. We then examine code as an external visual language of thought: a structured, executable representation that agents can construct and inspect. We test it in visual question answering task and find reconstructed visual code retains substantial information for question answering and, in some domains, supports higher accuracy than the original image. These abilities raise a further question: do agents draw on a shared internal representation of scene content beyond a particular drawing program? We explore an internal visual language-of-thought hypothesis, in which a shared, compositionally structured representation supports visual operations across drawing languages. Cross-harness drawings and images assembled from independent single-pixel queries exhibit related layouts and tones. Agents also maintain self-generated room arrangements across viewpoints after visible drawings are removed. These results demonstrate that the coding agent would maintain a consistent and coherent world inside its imagine even before the harness gets involved and the generation starts.

∗^{*}These authors contributed equally to this work.

1. Introduction

In recent years, text-to-image generation has largely relied on end-to-end generative models, including latent diffusion models, rectified-flow transformers, and autoregressive models [9, 26, 27, 37]. Despite their considerable success, these approaches encode the generation process in learned neural networks, leaving the details of image construction largely implicit in model parameters. In contrast, modern agents offer a programmatic alternative: they can write and execute programs, coordinate tools, and iteratively refine their actions over multiple turns [18, 35]. These developments motivate our central question: How far can general-purpose coding agents go in visual generation?

We first assess these agents as zero-shot drawers using harnesses ranging from individual pixels and geometric primitives to Canvas 2D programs, SVG documents, and a graphical painting application. To evaluate these coding agents, we introduce AgentDrawBench, a 200-prompt benchmark spanning multiple domains. We will publicly release the benchmark to support further research on agent-based visual generation. Our results show that these agents are strong in structural fidelity but fall short in perceptual realism compared with native image generators. In particular, GPT-6-Astra with Canvas 2D achieves 85.8% structural fidelity, compared with 68.8% for gpt-image-1 and 90.7% for gpt-image-2. On design and symbolic tasks, where precise control matters more than photorealistic appearance, GPT-6-Astra with Canvas 2D achieves a 92.0% holistic win rate against gpt-image-1, judged by gemini-3.5-flash. This task-dependent profile reveals the potential of coding agents for visual generation without a dedicated image generator. These results raise a further question: can agents also use visual programs to organize and reason about the scenes they depict?

The language-of-thought hypothesis proposes that thinking operates over structured mental representations whose meanings depend on their components and how they are combined [24]. Drawing on this perspective, we frame visual code as an external visual language of thought: a structured, executable medium for organizing, manipulating, and reasoning about visual content. We examine whether code can serve this role in both visual generation and understanding. For generation, the agent achieves 83.0% structural fidelity using code alone, close to the 85.6% achieved when it can inspect intermediate images. For understanding, we sample 200 visual question answering tasks from WorldBench [36] covering a broad taxonomy of real-world visual concepts and reconstruct the question images as SVG code. We find that answering from source code achieves 69.0% accuracy, compared with 65.0% from the render and 74.0% from the original image. In the academics and digital-world domains, the agent answers questions more accurately using code than using the original images.

With code serving as an external visual language of thought, we next ask whether capabilities that emerge in large language models translate to drawing with code. Specifically, we examine whether code-based drawing benefits from test-time scaling and in-context learning using procedural drawing guidance from human demonstrations. We find that extending refinement to a fourfold budget yields a modest structural improvement and only a 50.5% holistic win rate against the standard run. Analysis of the outputs points to the importance of the drawing interface. For in-context learning, we provide procedures distilled from human drawing demonstrations, including stroke operations, construction order, value grouping, and edge control, enhancing the drawing interfaces. Guided by these procedures, the agent reconstructs reference images in Chinese ink, charcoal, watercolor, and oil painting, producing expressive, medium-specific visual effects. These experiments highlight the role of drawing interfaces in perceptual quality. They also illustrate how code can serve as a working representation for visual thinking, enabling agents to apply medium-specific drawing procedures supplied in context.

Across these external expressions, a recurring pattern emerges: independent drawings of the same prompt can share coarse layouts and color choices across different harnesses (Fig. 6). Could these recurring visual choices reflect a shared internal representation of scene content? We formulate this possibility as an internal visual language-of-thought hypothesis: agents may use a compositionally structured representation of entities, attributes, and relations to construct, interpret, and transform scenes through different external expressions [23, 24]. The hypothesis motivates two behavioral properties: consistency, the recurrence of scene-level choices across forms of expression, and coherence, the coordination of entities and relations under visual transformations.

We investigate these properties through complementary probes. We quantify cross-harness consistency and test independent single-pixel queries, each made without access to any other query's answer. The assembled images recover regions and tones similar to whole-image drawings. To examine spatial coherence, agents choose furniture arrangements and revisit them from different viewpoints. Scene organization remains largely consistent after earlier SVGs are removed, including a condition that also removes the furniture list. Fresh calls given only the furniture list and turn history show lower agreement across revisits and between views and floor plans. Together, the results provide complementary behavioral support for the internal visual language-of-thought hypothesis.

Our contributions are:

• We characterize agents as zero-shot drawers, identifying strong structural fidelity and precise control alongside limits in perceptual realism, and examine how feedback, refinement, and drawing interfaces affect their performance

(Secs. 4 and 5).

• We study code as an external visual language of thought, showing how reconstructed SVG programs support question answering about scene content (Sec. 5).

• We formulate an internal visual language-of-thought hypothesis and investigate complementary evidence for reusable scene content through cross-harness consistency, independent pixel queries, and spatial coherence in self-generated rooms (Sec. 6).

References (32)