172 fruits
an experiment in getting an image model and a coding agent to illustrate a map of fruit trees
The first fruit icons for a map of fruit trees I was prototyping were drawn by Claude, in code, one SVG path at a time. Each tree on the map gets a pin, with a ring around it that marks the months its fruit is ripe, and the pin needs a picture of the fruit. Claude produced thirty silhouettes, one for each fruit in the catalog. I called them far from ideal, and we fell back to emoji.
Emoji cover twelve of those thirty fruits. There's no emoji for a fig, a plum, a persimmon or a pomegranate, let alone a jabuticaba or a pitanga, so the map mixed emoji with tiny photos pulled from iNaturalist. The missing illustrations were the prototype's biggest problem, and polishing anything else wasn't going to hide that.
two halves of an illustrator
When I asked Gemini for a sheet of fruit silhouettes, it came back with what the first thirty were missing: solid black shapes with the details cut out in white, and a pear that was obviously a pear. Gemini only draws in pixels, though, and a pin on a map needs a vector it can recolor and scale. Claude has the opposite problem. It writes valid SVG all day, but drawing a pear by typing coordinates is how we got the first thirty.
So Gemini drew, and Claude traced.
cutting up the sheet
Peter Selinger's Potrace already turns black-and-white bitmaps into curves, and Claude used a pure-Python port of it called potracer, so most of the work went into getting the icons off the sheet. The script finds the rows on a sheet as horizontal bands of dark pixels taller than 80 pixels, since titles and labels are shorter, then finds each icon as a run of columns inside its row. It upsamples the icon four times, traces it, and centres it so its smallest enclosing circle fills a 100 by 100 viewBox.
Then came size. Fitted to the same circle, a round persimmon reads far bigger than a pair of cherries,
because it fills so much more of it. I said the icons were too small, then too big, then
that the watermelon had too much empty space at the bottom (the watermelon didn't make the final
set). We settled on measuring how much of its circle each icon covers and shrinking the dense ones by
(0.45 / coverage) ** 0.4, so a cherry keeps its full size and a persimmon gives some
back.
That gets a whole set to roughly the same weight. It doesn't make each fruit sit right in its pin, so I asked for a board in Figma with every fruit at real size inside a pin and only the icon layer unlocked. The white and black versions of each pin sat beside it and followed along live. I moved and resized every one by hand. A script then read each icon's position back as a scale and an offset, and wrote those into the catalog.
four stray accents
One bug I caught by eye in Figma. Four fruits from the Brazilian sheet had a tiny dash floating near the bottom of the icon. Their labels were BUTIÁ, JERIVÁ, ARAÇÁ-BOI and ARAÇÁ. The acute accents stand a few pixels above the capitals, and so a few pixels below the row of icons, and the tracer padded every crop with three or four pixels of the sheet around it. That was enough to catch the top of an accent. The dash also pulled those four icons off-centre, since it counted as part of the shape when the circle was fitted.
The fix was to pad with white instead of with the sheet. It took a sheet of Brazilian fruit labelled in capitals to produce the bug in the first place.
from 30 to 172
Once the drawings existed, a catalog of thirty fruits looked thin. I asked Claude which fruits people actually pick, from a tree to a vine, that the catalog didn't have. It came back with 142 candidates, each matched to its iNaturalist taxon. Then it wrote the prompts for seven more sheets and traced those the same way. I fitted the new 142 in Figma, like the first thirty.
Good illustrations also made the rest of the prototype look plain. Claude's read was that the drawings only ever appeared at thumbnail size, and that every screen was built from the same card. I agreed, and the page for a single tree started opening with its fruit, large, inside the same ring of months its pin wears.
what the experiment left
The map is shelved for now, and it may never become an app. The tracing script lived on as a skill I can point at any sheet of silhouettes, white padding and coverage formula included.