There are a few ways to draw a Shape Up component with SVG. I used the algorithm mentioned in this Stack Overflow post to simplify my points to a single polygon per color, which was a really fun challenge. Then I pieced together a few other algorithms (largest rectangle in a matrix, number of islands) to generate a component that reduces to the smallest number of rectangles possible, for an (not always) even smaller data payload than the polygon per color algorithm. I'm comparing the rough size in memory of the data being used for each SVG. All SVGs include a white stroke to illustrate how they're being structured

polygon per pixel

31.480 KiB

rect per pixel

22.012 KiB

polygon per color

4.529 KiB

larger rects

4.043 KiB