1
0 Comments

Claude can't generate images. So I made it write code that does — and for my use case it beats GPT Image 2

Here's a thing people don't realize about Claude: it can't generate images.
There's No ChatGPT, no Gemini Nano Banan, no "make me a picture" button.

When I started, I saw that as a gap.
Now it's my favorite part of the workflow.

I build blog covers, infographics, and social creatives across a handful of brands. Early on I tried the obvious route the image models.

And they kept failing at the exact things that matter for marketing assets:

  • Text comes out garbled or misspelled
    (a dealbreaker when the image IS a headline).

  • Brand colors drift — you ask for one hex, you get a vibe.

  • Nothing is reproducible. Regenerate and it's a different image.
    Want the same layout with new copy? Good luck.

So I flipped it. Instead of asking Claude to draw an image, I have it write code that builds one — SVG for the layout, a small script to inject the content, then a headless browser screenshots it to a pixel-perfect PNG.

The difference is night and day:

  • Text is exact: it's real rendered type, not a hallucinated guess.
  • Brand colors are exact: they're literally the hex codes.
  • It's reproducible and templated: one frame, infinite posts. New blog? Swap the title and the data, re-run, done in seconds.
  • It's version-controlled: my designs live in git like code, not in a folder of one-off PNGs.

I went from "AI can't design for me" to shipping consistent, on-brand images faster than I ever did in a design tool — because I stopped treating design as a drawing problem and started treating it as a rendering problem.

The lesson I keep relearning: a tool's "missing feature" is sometimes pointing you at a better workflow. Image models are magic for art. For brand assets that need precision, code quietly wins.

Question for the room: anyone else generating visual assets with code instead of image models? Curious what you're rendering — and where it breaks down at scale.

If you want the proof, visit:

RankInAiOverview : https://www.rankinaioverview.com/blog?utm_source=indiehackers&utm_medium=social&utm_campaign=build-in-public&utm_content=images-from-code

GetRankOnMap : https://www.getrankonmap.com/blog?utm_source=indiehackers&utm_medium=social&utm_campaign=build-in-public&utm_content=images-from-code

P.S. — that whole grid of images above? Yeah… also made this way. Claude wrote the code, a headless browser took the screenshot. 😎

on July 3, 2026
Trending on Indie Hackers
The hardest part isn't building anymore User Avatar 56 comments I sold $6,773 in 2 weeks, with almost no existing community. User Avatar 56 comments Ferguson is LIVE on ProductHunt today... so I audited their homepage first! User Avatar 37 comments Why Remote Teams Stop Talking (And Don't Even Notice It) User Avatar 35 comments Built a local-first Amazon profit-by-SKU + QuickBooks/Xero journal tool. Looking for founding users. User Avatar 32 comments Before you build another feature, use this workflow User Avatar 30 comments