TL;DR
What if Monet’s brushwork or Klimt’s golden flecks weren't trapped inside opaque neural network weights, but written as clean, modular Python functions? CodeArtist introduces a painting engine that distills artistic styles into executable programs—separating what is drawn from how it is painted. This allows coding agents to generate consistent animations, edit fine details on the fly, and even lets cheap, lightweight models inherit the artistic mastery coded by expensive frontier models.
What Problem Does This Paper Address?
Right now, if you want an AI to generate stylized visuals or animations, you are stuck between two extremes:
- Diffusion models produce gorgeous imagery, but their understanding of "style" is locked inside implicit latent representations. Over a long video or across separate scenes, styles drift stochastically. Plus, if you want to tweak a single brushstroke rule or move one object without altering the rest of the canvas, good luck.
- Coding agents (LLMs writing Python scripts to render graphics) are great at spatial layout, narrative timing, and deterministic control. However, when asked to mimic an artistic style, they have to look at a reference image and reinvent low-level drawing code from scratch for every single scene. This is slow, expensive, and visually inconsistent.
The authors ask a simple, compelling question: Can we distill artistic style from reference artworks into a reusable, transferable, and improvable executable program?
Methods
Inspired by classical procedural painterly rendering from the 1990s and modern reusable code libraries, CodeArtist splits visual generation into two distinct stages: Scene Construction and Style Rendering.
First, a coding agent translates a user's prompt into a narrative timeline and shot scripts. Crucially, running a shot script doesn't output pixels. Instead, it outputs a style-agnostic list of primitives—polygons, paths, and text tagged with semantic roles (like "background" or "highlight").
Second, the CodeArtist engine renders those primitives by invoking a modular Python style program—without the downstream agent ever needing to see the original reference art. What's novel here is how coding agents distill style into three explicit, complementary code modules:
- Palette: Captures color distributions and statistics, mapping semantic roles to specific color mixes.
- Brushwork: Procedurally samples points along primitive paths to control stroke shape, angle, width, and bristle marks.
- Texture: Simulates physical media surfaces—like translucent wet-edge pooling for watercolor, or thick layered underpainting for oils.
Datasets
The authors evaluate their system on 30 diverse visual generation tasks conducted within the Harbor evaluation environment. Because judging art programmatically is tricky, each task features a custom, six-dimensional rubric derived from expert analyses of the reference artworks (evaluating series coherence, composition, color, material fidelity, abstraction, and completion). Beyond the 30 core tasks, they test practical creative workflows including multi-shot music videos, cohesive UI icon sets, and multi-turn figure editing. No pre-existing training datasets are used, as styles are distilled into code modules rather than trained via gradient descent.
Key Insights and Ideas
- Artistic "skill transfer" from giant to tiny models: Because style lives in Python code with a clean interface, a massive frontier model can do the heavy lifting of writing or upgrading a style module once. Afterward, fast, cheap models can invoke that exact module—producing superior art at a fraction of the cost without ever looking at the reference image.
- Surgical, bug-fixable aesthetics: If an image looks too flat or the colors feel cold, you don't play prompt roulette. A stronger model can inspect the code, overhaul just the
brushorpalettefunctions, and every scene rendered with that style immediately inherits the upgrade. - Plug-and-play restyling: Because scene geometry and motion are strictly decoupled from rendering, switching a running animation from Van Gogh’s impasto to Qi Baishi’s ink wash is literally a one-line import swap.
Key Results
The authors tested six coding agents across three families (DeepSeek-V4/V4.1-Flash, GPT-5.6-Sol/GPT-6-Astra, and Claude-Haiku-5.5/Opus-5.5), comparing CodeArtist against a baseline where models view the reference artwork and code each scene from scratch:
- Higher Visual Quality: Evaluated by a VLM judge (Gemini-3.8-Flash, which achieved 74.83% macro-average agreement with human evaluators), CodeArtist boosted the average Visual Score across all models from 34.93 to 38.42.
- Nearly 2x Faster and Cheaper: By reusing style code instead of reinventing low-level rendering per prompt, average runtime dropped by 49.2% (from 8.07 to 4.10 minutes) and API costs fell by 49.1% (from $0.4036 to $0.2053 per task).
- Cross-Scene Coherence: Qualitative tests (such as generating a full Last Christmas music video and custom paper icons) showed rock-solid stylistic consistency across shifting lighting, layouts, and object types.
Limitations and Future Work
The authors openly note that CodeArtist is "an initial implementation instead of a mature rendering system"—describing it as a preliminary step toward executable art. Rather than locking down a finished graphics engine, they envision an open, evolving ecosystem: as foundation models grow more capable and community contributors refine the modular libraries, the shared codebase of palettes, brushes, and textures can continuously accumulate aesthetic expertise over time.
Summary updated