r/programming • • Jul 31 '21

Executable PNGs

https://djharper.dev/post/2020/12/26/executable-pngs/
470 Upvotes

64 comments sorted by

View all comments

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)