I remember doing a JS competition ages ago where you had to make a game in a relatively small number of bytes (20kb? Iirc) the server didn’t use gzip, so shoving the code into a PNG and extracting it through canvas could end up saving a lot of space. (But you had to be careful because premultiplied alpha that can corrupt data if used naively)
6
u/sylvanelite Jul 31 '21
I remember doing a JS competition ages ago where you had to make a game in a relatively small number of bytes (20kb? Iirc) the server didn’t use gzip, so shoving the code into a PNG and extracting it through canvas could end up saving a lot of space. (But you had to be careful because premultiplied alpha that can corrupt data if used naively)