
GENEATCG has a new mark. It is Genie, our first dog, drawn as a mosaic of Voronoi cells. You can see it in the corner of every page now.
From a leopard to Genie
The old icon was a leopard: the cells on its face came from Leopard, the mesh plugin for Grasshopper I released in 2017. I liked that it was computed, not drawn, and I wanted to keep that. But a leopard says little about GENEATCG today, and at the size of a browser tab its cells turned into an orange blur.


Genie was the obvious choice. He was a rescued stray from Taiwan who came all the way to Switzerland and Sweden to live with us (Adopting Genie), and he kept me company through the last year of my PhD. He died suddenly in 2023, only three years old (Remembering Genie). My wife and I already carry him with us as a tattoo. Now GENEATCG carries him too.
He was also easy to recognise. He had heterochromia: his right eye was pale blue, his left eye dark brown. And his ears were huge.
I did not want to draw him. I wanted the mark to come from a photo of him, the way the leopard’s cells came from a mesh.
Tracing the outline
My wife took the photo when we travelled to Engelberg Abbey in Switzerland: Genie sitting in the aisle, looking up, ears up, with that slightly smug look on his face.

The first step is to separate Genie from the church. GrabCut does this well when you give it a few hints: some rectangles that are surely background (the purple banner, the pews) and some ellipses that are surely dog (his face and ears). It models the colours on each side and cuts the image where the two models meet.
The cut follows pixels, so its edge is a staircase. Simplifying it to a polyline removes the steps but leaves sudden turns, where the direction of the outline jumps. In a logo you see every one of them. So I treated the outline as a closed curve instead: resampled it at equal arc length, smoothed it with a Gaussian that wraps around the curve, and drew it as a spline through the smoothed points. The tangent of the result is continuous everywhere, and the curvature is large only where the shape really bends, at the tips of the ears.

Cells that look designed
A Voronoi diagram splits the plane into cells, one per seed point: each cell holds the points closer to its seed than to any other. Colour each cell with the average colour of the photo inside it and you get a mosaic.
Where the seeds go decides how it looks. I wanted small cells where the face has detail (the eyes, the nose, the corners of the mouth, the edges of the ears) and large cells on the plain white fur. Seeds thrown at random with that density work, but the cells come out uneven, some long, some tiny.
The fix is an old one, Lloyd’s algorithm: move every seed to the centre of mass of its cell, recompute the cells, and repeat. After about twenty rounds the cells settle into near hexagons, still small around the eyes and large on the cheeks, because the centre of mass is weighted by the same density. The result is a centroidal Voronoi tessellation, the same structure that shows up in honeycombs and in good mesh generators.


Colour, and the blue eye
Two things in the colours came from the church, not from Genie. The right side of his face is in shadow, and the shadow is blue-grey. I pulled those greys back towards warm white. Then I reduced all cells to fourteen colours, so the mark reads as a mosaic, not as a blurred photo.

The averages also removed the most important detail. A cell over his blue eye mixes the pale iris with the dark rim and the white around it, and comes out grey. His two different eyes simply vanished.
My first fix was to draw the eyes on top as circles. It worked, but they looked like stickers on a mosaic. The better fix stays inside the diagram. Around each eye I place a few seeds myself, in rings: one in the middle becomes the pupil, six on a small circle around it cut six wedge-shaped cells for the iris, a ring of sixteen makes a thin dark rim, and a last ring joins the eye to the fur. Seeds spaced evenly on a circle always cut cells like this, so the iris grows out of the same Voronoi diagram as the rest of the face. Lloyd’s algorithm leaves these seeds where they are; only their colours are chosen: pale blue for his right eye, dark brown for his left, and one light cell up and to the left as the catchlight.

For the background I first used the bronze of this site, but it was too close to the colour of his ears, and the outline disappeared. A darker espresso brown from the same family solved it.
Small sizes
A favicon is 16 by 16 pixels: 256 pixels in all. No detail survives that, and the eyes are the first to go. The small version uses fewer, larger cells and larger eye rings, but at 16 pixels what really carries it is the outline. Those ears are hard to mistake for anything else.

The whole mark is computed from one photo, a few hints and a handful of parameters, so it can be made again, at any size, or from another photo.
Why him
Genie sat next to me through the last year of my PhD, while I wrote about blocks that hold each other up. Now he sits in the corner of every page of this site, made from the kind of geometry I spent those years on.