Skip to content
HN On Hacker News ↗

Shipping 103,802 Dots in 82 KB

▲ 11 points • 0 comments • by speckx • 3w ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this text is a mix of AI and human-written content.

71 %

AI likelihood · overall

Mixed
29% human-written 71% AI-generated
SEGMENTS · HUMAN 5 of 8
SEGMENTS · AI 2 of 8
WORD COUNT 703
PEAK AI % 100% · §8
Analyzed
Nov 8
backend: pangram/v3.3
Segments scanned
8 windows
avg 88 words each
Distribution
29 / 71%
human / AI fraction
Verdict
Mixed
Pangram v3.3

Article text · 703 words · 8 segments analyzed

Human AI-generated
§1 Human · 0%

11 min readOct 25, 2026--How we packed our hand plotted dot art into a very compact binary format, reduced geometry delivery by 93% and stopped rendering the background entirely when nothing was changing.We do sell AI powered search and we use AI/LLMs for a whole host of things on a day to day basis at Layers but art generation is not one of them and that’s on purpose.Every illustration on uselayers.com was drawn by Alberto Larizza. Alberto is one of my closest friends and a fantastic pattern designer. He’s from Tuscany and did pattern work for houses like Gucci in Italy prior to coming over to the US.He drew it all in dots. 103,802 of them across 13 illustrations, each dot placed by hand over a number of months earlier in the year.We’ve always wanted them to move. This month Sumit, one of our product designers, finally got around to it, and the prototype was beautiful:Hover over one and the dots get pushed out of the way and then spring back. Tap it, and a shockwave goes through.There was one problem: the prototype had an 8MB JSON file that had every dot from the SVG. I had to figure out how to feasibly get these into the browser and have it work for lower-end devices w/o any jitter or lag on the page.Press enter or click to view image in full sizeAll 13 Layers illustrations rendered from their hand-placed dots: merchandising, search, recommendations and other product marks on the top row, category illustrations on the bottom row.175 MB of Illustrator ExportsAlberto did the Illustrator artwork. Sent over as SVG exports (65 files, a few zips at around 175MB) and 13 of those ended up on the site.Illustrator doesn’t export a dot as a dot. You end up with a mixture of <circle>, <ellipse> and <path> elements and any dot that’s been clipped or expanded will come out as a little bezier path with its own fill attribute.The security padlock is a perfect example: 2,510 circles, 470 ellipses, and 3,644 paths, which comes to precisely 6,624 dots in around 730KB.The browser only needs x, y and a radius per dot so step one was converting each SVG down to that:Press enter or click to view image in full sizeLog-scale bar chart: about 175 MB of Illustrator SVG exports, 1.25 MB as a Float32 export, 519 KB as uncompressed DOT2 and 82 KB as DOT2 with Brotli.There’s not much to say about the conversion really. The rest of this post is about getting 1.25MB down to 82KB.Three Floats per DotThe initial version shipped a Float32Array per illustration: [width, height, x, y, r, x, y, r, …], little-endian. 12 bytes a dot.// The original loaderconst floats = new Float32Array(await res.arrayBuffer())return { width: floats[0], height: floats[1], dots: Array.from(floats.subarray(2)),}Float32 is around 7 significant digits.

§2 Human · 0%

The widest example is 900px in source units and it renders at a few hundred CSS pixels.

§3 Mixed · 48%

412.3871 and 412.3906 end up on the same pixel so most of those digits are effectively wasted.(Same version also ran the hero background loop at 60fps continuously, even if the mouse was just sitting still.

§4 AI · 100%

Getting to that.)What Hand-Placed Dots Look Like as DataBefore I went to any format I spent a bit of time fiddling with the files.The first thing I noticed was rows. If you sort by y and then x, 78% to 99% of dots have the exact same y as the dot right before them.Alberto builds the pattern row by row and it appears in the numbers.Press enter or click to view image in full sizeA crop of the merchandising illustration with faint lines joining dots that share a row, above two strips showing that 90% of the y deltas are zero while none of the x deltas are.Radii are pretty much limited too.

§5 Human · 0%

The original nine illustrations each have somewhere between 104 and 228 distinct radius values.

§6 Human · 0%

The three latest have 900+ (again that’s our SVG converter reading the radii off the bounding boxes, float noise).

§7 Human · 0%

8-bit quantization will have flattened that out anyway.X is where the entropy is.

§8 AI · 100%

Nearly every x is fractional, and the neighbors in a row are a few px apart.I didn’t write a clever codec at all.