Re:Show HN: HN Avatars in 357 bytes
by styfle on Friday March 18, 2022 @05:02PM
(#30727479)
I wonder how `<canvas>` would compare to `<img src="data:image/svg..."/>` instead
[ Parent
| on HN ]
Yes! it did cross my mind, I was just more familiar with canvas API so I cracked on with it... but I suppose encoding a simple format like bitmap would be trivial, almost like being able to access the canvas pixel buffer but with a lower overhead.
This thread is a good perf test, I might give it a quick go.
Also as others mentions the pixelation style thing is now finally fully cross browser supported, which should make it easier to achieve nearest neighbour upscaling for url encoding.
[edit]
I underestimated how involved image format headers are!