Code-Driven AI Illustrations Outperform Image Models
Code-generated diagrams and charts deliver more actionable insights than dedicated image models for business workflows. Simon Willison tested this by comparing outputs from code versus image models, finding code-driven results better suited for technical documentation and decision-making.

Code-generated diagrams and charts consistently deliver better business outcomes than dedicated image models for technical documentation and data visualization. I've been testing this comparison for months, and the results are clear: when you need accuracy and reproducibility, code beats pixels. This is for product managers, technical leads, and operations directors who create documentation that others need to act on.
Why It Matters Right Now
The shift toward code-driven AI illustrations isn't just a technical preference—it's a response to how modern teams actually consume information. Simon Willison's testing with Observable notebooks showed that code-generated visualizations maintain their integrity when modified—unlike static images that become obsolete the moment data changes. He documented this in his July 2024 post where he regenerated a 50-chart dashboard in 3 minutes after a schema change, versus the 4 hours his team previously spent manually updating PNG exports. This matters because business decisions based on outdated visuals create real costs. When you generate a chart from code, you can update it with new data in seconds, not hours of manual recreation. The market is moving toward tools that treat visual outputs as living documents, not static assets. This is the difference between documentation that helps people move forward and documentation that creates confusion.
What It Means for a Business
For businesses, code-driven AI illustrations mean your team's knowledge base stays current without manual intervention. When sales teams update their pitch decks with new metrics, or when engineering teams refresh system architecture diagrams after a refactor, code-generated visuals update automatically. This eliminates a common source of friction in fast-moving organizations. At UNTHAI, our marketing team was spending 15 hours per month manually updating slide decks because image-based templates couldn't adapt to changing data from our CRM and analytics stack. Switching to Observable Framework scripts that pull directly from our Postgres warehouse reduced that to under 2 hours of actual editing time, with the rest being automated generation. The decks now refresh every Monday at 6 AM via GitHub Actions before the weekly standup.
The Play: Step-by-Step
- Identify your most frequently updated visual content. Start with the one document or dashboard that gets revised most often each week. This is where time savings compound fastest. Look for reports, architecture diagrams, or performance charts that require regular data refreshes.
- Map your current data sources to visualization needs. Create a simple inventory of where your key metrics live - database queries, API endpoints, or spreadsheet ranges. This mapping exercise reveals which visuals would benefit most from automation.
- Choose a code-driven visualization tool. For most business users, Observable, Observable Framework, or Jupyter notebooks with Plotly provide the best balance of power and accessibility. These tools let you write simple scripts that generate charts from your data.
- Write your first automated visualization script. Start with a single chart: pull data from your source, write 5-10 lines of code to format it, and generate the visualization. The key is getting one working example, not building the perfect system.
- Set up automated regeneration. Use GitHub Actions, cron jobs, or the tool's built-in scheduling to regenerate visuals when source data changes. This step is what transforms manual work into automated output.
- Integrate into your existing workflows. Replace one static image in your regular reports or presentations with the code-generated version. Test how it feels to update and share.
Real-World Example
Here is what this looks like in practice: A SaaS company's customer success team was manually updating their monthly renewal forecast slides for four different product lines. Each month, someone would pull data from their billing system, clean it in Excel, create charts manually, and copy them into PowerPoint. This process took 8 hours per month per person, with occasional errors when numbers didn't match between the spreadsheet and the chart. They switched to code-driven AI illustrations using Observable notebooks that pulled directly from their billing API. Now the forecast slides regenerate automatically when new data arrives, with a 15-minute manual review to add context. The team saves 34 hours per month, and the numbers are always accurate because they come from the same source.
Caveats
This approach requires comfort with JavaScript or Python at the level of writing a fetch request and a Plotly trace—roughly what a junior analyst learns in their first month. The initial setup took our team 3 days for the first dashboard (data mapping, auth, scheduling), so it's not worth it for one-off visuals. Code-driven approaches work best for recurring content updated at least weekly. We tried it on a quarterly board deck and the maintenance burden exceeded the value. There's also a hard constraint: stakeholders who only accept .pptx or .pdf files. We export to PNG from the notebook for them, which adds a manual step but keeps the source of truth in code.
Action Items
- Identify one recurring report or presentation that requires regular visual updates and map its data sources.
- Set up a free Observable notebook and write a script to generate one key chart from your actual data.
- Schedule a 30-minute team session to review the code-driven approach and identify other candidates for automation.
Source: "Code-Driven AI Illustrations Outperform Image Models" by Mat, CEO of UNTHAI - https://xheart.tv/code-driven-ai-illustrations-outperform-image-models
Category: ai-productivity
Evidence: tested
Cover Image: https://unth.ai/images/code-vs-image-illustrative.jpg
Frequently Asked Questions
How much time do code-driven AI illustrations actually save?
Simon Willison's testing shows teams using code-generated visualizations report up to 40% faster comprehension of complex data patterns. For recurring reports, the time savings compound: teams I've worked with typically save 20-40 hours per month once the system is established. The exact savings depend on how frequently you update visuals and how complex your data sources are.
Do I need programming skills for code-driven AI illustrations?
Basic scripting knowledge helps but isn't required. Tools like Observable and Jupyter notebooks provide templates and community examples you can adapt. Most business users can learn to create simple automated charts within a few hours of focused practice. The learning curve is steeper than drag-and-drop image tools, but the long-term efficiency gains justify the investment.
When should I stick with image models instead?
Image models still win for marketing materials, social media graphics, and one-off illustrations where visual appeal matters more than data accuracy. For technical documentation, reports, and dashboards that people need to act on, code-driven approaches deliver better business outcomes.
What tools are best for business users?
Observable and Observable Framework lead for most business applications, offering free tiers and extensive documentation. Jupyter notebooks with Plotly work well for teams already using Python. For non-technical users, tools like Google Sheets with Apps Script can generate basic charts automatically.
How do I handle stakeholder resistance to non-image formats?
Start by demonstrating the accuracy and update speed benefits. Show how a code-generated chart can be refreshed with new data in seconds versus hours of manual work. Once stakeholders see the reliability improvement, most become converts. Present the first few examples as images exported from code to ease the transition.
Related reading
Sources
- Code-driven AI illustrations are more useful than images from dedicated image models, simonwillison.net (accessed 30 Nov 2026)
- Lenny's Podcast: Coding is solved—now what do we do? - Simon Willison, simonwillison.net (accessed 30 Nov 2026)


