Prompting

Turn Any Photo Into a Painting Claude Draws With Code: No Image AI, Just Python

Anthropic gave one photo of New York to three Claudes and had each one write Python that paints it. What each model painted, why the cheaper Sonnet 5.5 came close to Opus, and a prompt that does the same with any photo you have.

5min read
1prompts to copy
5numbered steps
5sections

When Anthropic released Claude Sonnet 5.5 on September 28, its guide for developers, "Building with Claude Sonnet 5.5", opened with an unusual test: one photograph of New York at sunset, handed to three Claudes, and each one had to write a Python program that repaints it. No image model was used. Every picture was painted by code the model wrote: thousands of calls into a brush engine it built itself.

It's a neat way to see how well a model can look at something and rebuild it, and you can run the same thing on your own photos with one prompt.

What each Claude painted

The photo is Manhattan from the air at sunset: an orange sky, the skyline catching the last light, a dark sea of rooftops, and the East River with the Williamsburg Bridge in front. The demo, by Lance Martin at Anthropic, shows the canvases filling in stroke by stroke.

  • Claude Sonnet 5, the previous Sonnet: a strong sunset sky, then the city as flat bands of dark rectangles with one glowing tower in the middle. It looks like a skyline, not like this skyline. Its program made 12,249 calls to its brush engine.
  • Claude Sonnet 5.5, the new one: the same sky, then a city that thins out into the haze, a cluster of towers catching the light where they stand in the photo, the river, the bridge and the buildings in front. 44,561 calls.
  • Claude Opus 5.5, Anthropic's most capable model: a very similar picture to Sonnet 5.5's, with the lit towers, the river and the bridge.

The prompt

Attach a photo in Claude, paste this under it and send. Claude looks at the photo, writes a small painting program with its own brushes, runs it, and hands you the painting, a side-by-side with your photo and a timelapse of it being painted.

PASTE INTO CLAUDE WITH YOUR PHOTO
I've attached a photo. Paint it with code: write and run a Python program
that paints this photo stroke by stroke, the way a painter would. No image
generator, no filters, and never paste or warp the photo's pixels onto the
canvas: every mark has to be a brush stroke your own code places.
1. LOOK FIRST. Before any code, describe the photo like a painter would:
where the light comes from, the big shapes from back to front (sky,
distance, middle, subject, foreground), the 6 to 10 colours that
matter, and the details that make it recognisable.
2. BUILD A BRUSH ENGINE, with numpy and Pillow only:
- a canvas with a light paper or canvas texture
- stroke(): a tapered, slightly curved stroke with bristle streaks,
a width, a colour and an opacity
- wash(): a broad, soft, uneven layer for skies and backgrounds
- dab(): a short thick touch for leaves, lights and texture
- glaze(): a thin transparent layer that warms, cools or darkens
Count every call.
3. PAINT IN LAYERS, from big to small:
- washes for the sky and the large areas
- the main shapes blocked in with big strokes
- medium strokes that follow the direction of each form and edge
- smaller and smaller strokes only where the photo has detail, the
smallest along the sharpest edges so outlines stay crisp (tens of
thousands of strokes is normal)
- the brightest highlights and darkest accents last
Take each stroke's colour from the part of the photo it covers, with
only slight variation. You can read the photo to pick colours and find
edges, like a painter looking at the subject, but the canvas only ever
gets strokes.
4. SAVE painting.png (1200 px on the long side, same shape as the photo),
comparison.png (photo and painting side by side) and timelapse.gif
(the painting building up, about 30 frames). Tell me how many
brush-engine calls it took.
5. CRITIQUE AND REPAINT. Compare the painting with the photo, list the
3 biggest differences, then paint one more pass that fixes them and
show me the final painting.
Style: oil painting.

Change the last line for a different look: watercolour, gouache, impressionist, palette knife, or "a 1950s travel poster".

Free, for your email

Get the full setup steps + the copy-paste setup prompt

The rest of this guide (3 more sections) opens right here. The setup prompt, one paste into Claude that sets it all up, comes by email only. Use your real address.

Unlocks: How to run it · Get a better painting · What to expect

50,000+ follow where these guides come from. No spam, reply “unsubscribe” any time.

Free MCP directory

Make your AI 100x more powerful.

Connect Claude, ChatGPT or Cursor to the apps you already use. Thousands of servers, one click to set up.

Browse free MCP servers

Read next