Can Claude Code generate images?
No, not directly. We asked it to generate a PNG of a red circle and save it; no image appeared. What it did instead was offer to write a script that would draw one, then run it with your approval. That's the honest shape of the capability: it's a coding agent, so it produces the code that produces the picture. For reading images it points the other way — that part works.
Asked for a PNG, got an offer to write a script.
The prompt was deliberately unambiguous: generate a PNG of a red circle, save it as circle.png in this directory, and if you can't generate images, say so exactly. After 88 seconds the directory contained no circle.png. What came back was a choice of routes — write a gen_circle.py script first and run it after approval, or use a different language — followed by a request to approve the command.
Note what it did not do: claim an image had been created, or produce a description in place of one. It reached for the tool it actually has, which is writing and running code.
The counterpart result is worth putting next to it: reading an image works fine — it named the colour of a generated PNG in 9.7 seconds. Vision in, no generation out.
What to do instead.
The productive prompt is the one it offered itself: ask for a script. "Write a script that renders a red circle to circle.png and run it" gets you the file — via Python, Node, ImageMagick or whatever your machine has — plus something you can re-run and edit later.
For anything data-driven this is strictly better than an image model. A chart generated by code can be regenerated when the data changes; a picture can't.
Architecture diagrams, flowcharts and sequence diagrams have a text form — Mermaid, Graphviz, PlantUML — and that's where a coding agent is genuinely strong. Ask for the Mermaid source, keep it in the repository next to the code it describes, and let your docs pipeline render it.
The result reviews in a pull request like anything else, which no exported PNG ever manages.
Then you want a different product. This is a coding agent with no image generation behind it, and no flag turns that on. What it can do is call one for you: connect an image-generation service through MCP and the agent can drive it as a tool — the generation still happens in that service, not here.
Routes that actually produce a file.
Two practical paths, both of which keep the artefact reproducible instead of one-off.
Frequently asked.
Quick follow-ups people search after this question.