Growing poisonous plants out of arithmetic

Contents

I’m writing a book on naturally occurring poisons and venoms, all the plants, fungi, critters, and minerals that can quietly do you in. It mixes anecdotal and historical accounts of poisonings with the chemistry of why each one is toxic, and poisongarden.org is its companion test piece. It’s where I try out the entries, the tone, and especially the pictures before any of it goes anywhere near a printer. For the pictures I wanted a particular look: old engraved botanical plates, the kind Franz Eugen Köhler printed in the 1880s1, but in light ink on a dark page. How hard could that be? About two weeks, one half-written academic paper, and a still-unfinished garden hard, as it turns out, which is not what I had budgeted for the illustrations on a side project to a book.

Fair warning: there’s maths in here, because the whole bloody thing runs on it. Each equation gets its own box with a plain-English line underneath. I’m reasonably handy with this stuff, handy enough to be dangerous and not nearly handy enough to stop anyone with an actual maths degree from wincing, so if you’re one of those people, please be gentle. If equations aren’t your thing, skip the boxes. The pictures and the plain-English bits tell the same story, and there’s no quiz at the end.

Attempt one: throw a diffusion model at it

The obvious move in 2026 is to type “foxglove, engraving style, dark background” into an image model and wander off to make coffee. I tried that. The results were fine, in the way hotel art is fine.

I had a few problems with them. Every image meant a GPU running flat out for a while, and I’d need hundreds of them, redone every time I changed my mind about the style (which is constantly). They also looked like AI, and you know the look I mean, where everything is plausible and nothing is actually anywhere. But the one that really killed it for me was that I couldn’t trust them with the small details, the bits that make a foxglove look like a foxglove rather than a vaguely foxglove-shaped smudge. If I’m putting a name under a picture, I want the picture to actually look like the thing, and “roughly right” is a shit answer.

Attempt two: remember the 1980s

Then I remembered that games have been drawing whole worlds out of pure maths for about as long as I’ve been alive. Rogue (1980) built a new dungeon every time you died, which for me was a lot. Elite (1984) crammed eight galaxies of 256 star systems each onto a home computer by generating them from a seed number instead of storing them. The demoscene took it to absolutely daft lengths: .kkrieger (2004) is a complete first-person shooter in 96 kilobytes. Minecraft grows a world with roughly seven times the surface area of Earth from a single seed, and No Man’s Sky (2016) went for 18 quintillion planets, each with its own procedurally grown plants and animals, which is a lot of planets for me to have not visited.

The trick behind all of them is basically the same. You don’t store the picture. You store a recipe and a roll of the dice, and the computer cooks it up when you ask for it. Roll the same dice and you get the same dinner; roll different dice and you get a new dinner from the same recipe. For a garden that’s perfect, because every foxglove on the site can be its own specimen and none of it needs a GPU cooking in the corner.

Four foxgloves drawn by one program with four different seeds

One foxglove program, four seeds, four specimens. These are the real drawings from the site.

People worked all of this out long before me, and I leaned on them heavily. Aristid Lindenmayer’s rewriting systems from 19682, developed with Przemyslaw Prusinkiewicz into The Algorithmic Beauty of Plants (1990)3, sit under nearly every procedural plant since. Jason Weber and Joseph Penn’s parametric trees (1995)4 showed how far a handful of controls can take you. Adam Runions and colleagues grew leaf veins by simulating competition for space (2005)5. On the drawing side, Georges Winkenbach and David Salesin’s computer-generated pen-and-ink illustration (1994)6 and Oliver Deussen and Thomas Strothotte’s pen-and-ink trees (2000)7 had exactly the look I was after, done decades ago by people who properly knew what they were doing.

So there were rules for plausible plants and rules for engraved lines, and to be clear, people have been modeling particular species for years as well. Botanists calibrate L-systems against measurements of real crops like maize and canola,8 graphics researchers have rebuilt individual plants from photographs,9 and in the last year or so people have started getting language models to help write plant models too.10,11 Most of that work is after accurate 3D structure for science or rendering, though. What I wanted was much smaller than any of that: drawings in one particular style for my own site, built from rules, that look like the actual plant they’re labeled as. Mostly I was borrowing all that existing tech and knowledge to get a look I liked, and, as is tradition with me, making it far more complicated than it ever needed to be along the way.

The rabbit hole

This is roughly where I stopped sleeping properly. It’s also the story of my whole life with science and technology, if I’m honest: I go looking for one thing and fall straight into a patch of muck I didn’t know was there (if I had, I’d have walked around it). It’s a bit gross at first, but once it dries you get to pick bits off and turn them into trivia, which is more or less what this entire post is. I’m not claiming to have invented anything here. I had a problem, went looking for a fix, and ended up knee-deep in a field of science and maths I never meant to wade into.

A frontier language model has read an enormous amount of botanical writing, and it can look at pictures. So what if I gave it a decent pile of reference images (old plates, field photos) on top of everything it already knows from the text, and asked it to write down the handful of features that make this plant this plant? Not “a spike of flowers”, but “the bells all hang to one side of the stem, crowd towards the top, and have spotted throats”. Then have it turn those observations into drawing rules, which are just plain arithmetic driving vector strokes, with a random seed so that every plant it grows comes out a bit different.

Then you loop it. Think of a police sketch artist working with a witness: draw, hold it up, get told “no, the nose is longer”, fix the nose, hold it up again. Here the program draws the plant at eight different seeds, the model sets those beside the references, names the three worst things wrong, and then it fixes them, either by nudging a number or by scrapping a rule and writing a better one. Repeat until the drawing reads as the plant, or until I get fed up, whichever comes first.

Diagram of the render and revise loop

The loop, run once per plant. The amber arrow is where all the actual work happens.

I should be upfront about who did what here. I’m the ideas person with strong opinions about what a foxglove looks like. Again, since it’s 2026 and we just vibe now, I asked Claude nicely to write nearly every line of the drawing code (16,276 of them, across 33 plants) and do most of the looking, measuring, and fixing. I didn’t sit idle, though. I read through the code and the output to make sure it wasn’t tripping over itself, asked a lot of annoying questions, suggested changes, and said “no, that’s crap!” and “you are doing it wrong!” in various ways. (I’m handier with code than with maths, but probably still mostly dangerous.) At one point, I also told it the drawing “looks like a sick and dying version of ‘maybe’ a Jerusalem cherry plant.” That quote is now in the research records, and I’ll have to live with it.

What happened

A few of my favorite cock-ups, because they show how this goes wrong in genuinely useful ways.

The foxglove followed the textbook

With no images to go on, the model placed the bells using the golden angle, about 137.5 degrees. It’s the same trick a sunflower uses to pack its seeds12: turn by that angle before placing each one and no two ever line up on the same spoke. That’s perfectly good botany, but it also put bells on both sides of the stem, and a foxglove doesn’t look like that at all. Its flowers hang down one side, and that lopsidedness is exactly the thing you recognize it by.

Foxglove bell placement: golden-angle spiral versus one-sided spike, with the real drawings

Left pair: the golden-angle rule and the drawing it made. Right pair: the one-sided rule and the drawing it makes now.

The fix was a new rule that puts every bell on one side and spaces them so they bunch up towards the tip.

The funny part is that the same golden angle turned out to be exactly right for the hemlock’s flower umbrellas and the sago palm’s crown, so the rule itself wasn’t wrong. It just described how the plant is built rather than how it looks, and those turn out to be very different things.

The Jerusalem cherry started as five sticks

As a deliberate test, I had it draw one plant from a written description alone, no pictures. It came out as a stiff fan of five branches that no amount of tuning was ever going to turn into a bush. After my review (see above), the model and I decided to throw the whole approach out, and to be honest, to hell with it, it deserved to go.

The new version grows more like a hedge that’s been trimmed into a dome. Shoots grow inside an invisible dome shape, turn back when they get near its edge, and kink left and then right at every node, so you can never trace one straight branch from the trunk out to a tip. That little bit of wonkiness is what makes it read as a bush rather than a diagram of one. It turns out that bushes and their cousins, shrubs, tend to like a bit of wonkiness.

Jerusalem cherry: the first fan-shaped drawing, a sketch of the growth rule, and the final bush

The text-only fan, a sketch of the new rule, and the final drawing.

Then the berries started punching black holes in the leaves. I’ll come back to why in the Calabar bean bit, because it’s the same problem.

Bloodroot was photographed from the wrong angle

All four of the original reference photos looked straight down on the plant. It turns out there’s a real shortage of bloodroot photos shot from ground level; most of the ones on the interwebs are taken from above. That’s a bit like judging how tall someone is from a drone shot: technically a photo of them, completely useless for the question you’re asking. Drawn from those photos, the flowers towered over the leaves on long stalks, like, in the lead model’s words, “a bouquet of daisies”. One side-on photo showed that the flower barely clears its own leaf, and that fixed the proportions a good bit. Honestly, this would have been a lot easier if ants had iPhones and Instagram accounts. Imagine that!

How viewing angle squashes a leaf, and bloodroot before and after a side-on reference

The same round leaf seen from three camera heights, then bloodroot drawn from top-down photos and after one side-on photo.

Along the way the leaf changed shape too. The first version was a cardioid, the classic heart-shaped curve, which comes with exactly one knob: turn it up and the notch where the stalk joins gets deeper, but the whole leaf goes square along with it. The fix was to start with a circle and take a bite out of it with a bump-shaped curve, which gives you two knobs, one for how deep the bite goes and one for how wide it is.

Cardioid leaf versus a disc with a gaussian notch

One knob versus two, computed with the generator’s own numbers.

The Calabar bean has a black groove, on a black page

The Calabar bean’s seed has a dark groove running down its face, and you can’t draw dark with light ink. On paper, every pen stroke makes things darker. On this site’s near-black page, every stroke makes things lighter, so everything an engraver knows about shading runs backwards. My honest first reaction when that clicked was “WTF!?”, followed shortly by “oh, obviously”. The fix is that a dark feature has to be reserved, left as bare page between two pale lips, a bit like leaving a gap when you shovel a path through snow.

Hatching darkens paper but lightens a dark page; the Calabar bean groove is left bare

Same hatching, two different grounds. On the right, the finished seed, with its groove left as bare page.

That’s also why the Jerusalem cherry’s berries looked like holes. An empty outline on a dark page is just a ring drawn around some darkness. The fix was a translucent color wash under each berry and heavier shading on the lit side, which is the exact opposite of what you’d do on paper.

It got cheaper as it went

Every finished plant left one lesson in a shared notes file that each later plant had to read first. The sago palm, near the end, needed one pass and about a third of the effort the Jerusalem cherry took, because the lessons about viewing angles, shading, and overlap were already baked in before it drew a single line.

Across all 33 plants I logged 210 things that went wrong. About 88 percent were caught by eye rather than by any measurement, and those usually needed a new rule rather than a tweaked number. The call that a drawing was actually finished usually came from a second opinion (a separate reviewer model, or me being a sarcastic pain in the ass) rather than from the model that drew it.

Why I find this interesting

As far as I can tell, and I’m happy to be corrected by people who read far more papers than I do, this is a different way of using AI for pictures. A diffusion model pulls an image out of what it has learned is typical. Here, the model’s knowledge gets spent up front, on deciding which features make a drawing look like a particular plant, and after that the drawing is plain arithmetic: curves, angles, and stroke spacing that anyone can read, check, and regenerate exactly. There’s still a big trained model in the loop, and I’m not going to pretend otherwise, but the pixels never come out of it. The rules do, and you can read the rules.

That matters because the thing diffusion models are worst at here, keeping the odd, species-specific detail instead of smoothing it towards average, is exactly what this approach is set up to protect.

To be fair to everyone who got here before me: pointing a language model at graphics code isn’t new. SceneCraft (Hu and colleagues, 2024)13 writes Blender scenes and checks them against renders, and BlenderAlchemy (Huang, Yang, and Guibas, 2024)14 edits 3D scenes with a vision-language critic. The loop I used borrows from Self-Refine (Madaan and colleagues, 2023)15, where a model critiques and improves its own output, and Reflexion (Shinn and colleagues, 2023)16, which carries those critiques forward as written memory. What I haven’t seen, and I’ve looked, though not as hard as a proper researcher would, is that kind of loop aimed at making a drawing look like one particular species, checked against old botanical plates, with lessons passed from plant to plant. If someone’s already done exactly that, I’d genuinely like to read it. I’ve also written the whole thing up more formally as a paper, linked at the end.

What’s next

First, the honest bit: none of this is finished. The drawings and the maths behind them are very much still being fleshed out, and there are key details in the plants, the fungi, the one spider, and everything else that the maths gnomes are still grinding away at. A fair few of the plants are still missing their fruit or seeds, for a start. If I’m being really honest, I wrote this post because I didn’t feel like working on it today and have rationalized that writing about it counts as working on it. Maybe it’ll guilt me back into the code.

And to be very clear, since this whole thing is about poisonous plants: none of this is an identification guide, and neither are the drawings on the site. Please don’t take them out into the woods and start comparing leaves. If you want to learn this stuff properly, learn it from people who know it deeply, and start by poking it with a stick.

So to every botanist, armchair botanist, enthusiastic gardener, mycologist, and spider person: yes, I know. This is the fleshing-out phase, not the “it’s all done and totally awesome” phase. I’m learning as I go and permanently somewhere on the learning curve, so don’t bother poking me about the thing you spotted, because I’ll just ignore you anyway. (I’ve probably already noticed it. Probably.)

And a quick, slightly awkward wave to the folks over at r/PoisonGarden. I mostly lurk there, reading your posts and admiring your plants. I’d already started calling this project The Poison Garden before I stumbled onto the sub, which I’m choosing to take as proof that it’s just the natural name for the subject. I’m not growing anything toxic at the moment, only drawing and documenting it, so consider this my hello.

And one more thing, because I can already hear some of you typing. If the book gets picked up for publication, I’ll be hiring a proper human artist to make truly beautiful illustrations for the print version. These drawings are for the website and for working out what each plant’s illustration actually needs to show, not a way to dodge paying an illustrator. I’m a decent illustrator myself, as it happens, but my style is completely wrong for this project, and I honestly don’t have the time to sit down and learn proper botanical illustration. The people who do it well have spent years on it, and they deserve to be paid for that.

I’m saying all that because every time AI touches anything these days, someone turns up to shout “AI slop!” at it. Fair enough, some of it is slop. But if you’re allergic to the whole subject, this probably isn’t the site for you. It’s a site about science and technology, and whether you like it or not, AI is still part of science and technology, however sick of it you are. Go weave a basket while the rest of us nerds keep poking the new thing with a stick. We’re still working out what it’s actually good for, the same way we did with the web and smartphones. Technology is a wild creature that humans cough up every so often, and we’re never quite sure how it got here or what it’ll do if we turn our backs on it. The best thing to do is keep your eyes on it and don’t let it think you’re about to bolt, because running tells it you’re the prey. Whatever you do, DO NOT RUN!

Right now the expensive part is one big model doing everything, and that’s not sustainable if I want to draw a few hundred plants for the book without selling a kidney. The next step is handing the boring bits to smaller, cheaper tools. Classic computer vision, OpenCV and friends, can measure a lot straight from reference images: leaf outlines, width against height, and how the flowers are spaced along a stem. That could produce the starting rules for a new plant without a frontier model squinting at every pixel. The big vision model then only has to act as the judge, looking at the result beside the references and saying which way the numbers need to move.

I’m curious how far that goes. Probably further than I expect, and it’ll definitely take longer than I expect, which is more or less how I ended up writing an academic paper about the pictures for a book’s companion website.

You can watch the garden grow at poisongarden.org, where every plant is drawn fresh from its own rules.

And if you’d like the same story in a more boring format, with proper academic English, no swearing, and two columns (which is how you know something is serious), you can download the paper (PDF).

How this was made: this essay, like the drawings, was a collaboration with Claude. I brought the ideas, usually by rambling on and on about things (most of which had nothing to do with this essay), then reviewed every bit of the code and output, asked questions, suggested changes, and swore at it whenever it stopped making sense. Claude drafted the text, the figures, and the code, and turned my rambling into something readable by mortals. Nothing here went anywhere without going past me first. The sarcasm and swearing are mine.

Footnotes

  1. Köhler, F. E. (1887). Köhler’s Medizinal-Pflanzen. The plates that set the look. Wikipedia ↩

  2. Lindenmayer, A. (1968). Mathematical models for cellular interactions in development. Journal of Theoretical Biology 18(3), 280 to 299. doi:10.1016/0022-5193(68)90079-9 ↩

  3. Prusinkiewicz, P., and Lindenmayer, A. (1990). The Algorithmic Beauty of Plants. Springer-Verlag. Free PDF from the Algorithmic Botany group ↩

  4. Weber, J., and Penn, J. (1995). Creation and rendering of realistic trees. SIGGRAPH ‘95, 119 to 128. doi:10.1145/218380.218427 ↩

  5. Runions, A., et al. (2005). Modeling and visualization of leaf venation patterns. ACM Transactions on Graphics 24(3), 702 to 711. Project page and paper ↩

  6. Winkenbach, G., and Salesin, D. H. (1994). Computer-generated pen-and-ink illustration. SIGGRAPH ‘94, 91 to 100. doi:10.1145/192161.192184 ↩

  7. Deussen, O., and Strothotte, T. (2000). Computer-generated pen-and-ink illustration of trees. SIGGRAPH 2000, 13 to 18. Paper page at Uni Konstanz ↩

  8. Cieslak, M., Khan, N., Ferraro, P., Soolanayakanahally, R., Robinson, S. J., Parkin, I., McQuillan, I., and Prusinkiewicz, P. (2021). L-system models for image-based phenomics: case studies of maize and canola. in silico Plants 4(1). doi:10.1093/insilicoplants/diab039 ↩

  9. Quan, L., Tan, P., Zeng, G., Yuan, L., Wang, J., and Kang, S. B. (2006). Image-based plant modeling. ACM Transactions on Graphics 25(3), 599 to 604. doi:10.1145/1141911.1141929 ↩

  10. Yun, H., et al. (2026). A vision language model for generating procedural plant architecture representations from simulated images. arXiv:2603.22622 ↩

  11. Hadadi, M., et al. (2026). FloraForge: Procedural generation of editable and analysis-ready 3D plant geometric models using LLM-assisted template design. Smart Agricultural Technology. doi:10.1016/j.atech.2026.102316 ↩

  12. Vogel, H. (1979). A better way to construct the sunflower head. Mathematical Biosciences 44, 179 to 189. The golden angle, done properly. doi:10.1016/0025-5564(79)90080-4 ↩

  13. Hu, Z., et al. (2024). SceneCraft: An LLM agent for synthesizing 3D scenes as Blender code. arXiv:2403.01248 ↩

  14. Huang, I., Yang, G., and Guibas, L. (2024). BlenderAlchemy: Editing 3D graphics with vision-language models. arXiv:2404.17672 ↩

  15. Madaan, A., et al. (2023). Self-Refine: Iterative refinement with self-feedback. NeurIPS. arXiv:2303.17651 ↩

  16. Shinn, N., et al. (2023). Reflexion: Language agents with verbal reinforcement learning. NeurIPS. arXiv:2303.11366 ↩