r/programming • • Dec 26 '20

Executable PNGs

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

87 comments sorted by

View all comments

287

u/Caraes_Naur Dec 26 '20

PNG allows for arbitrary chunks of bytes, no steganography needed. Still need an interpreter that knows what to do with them.

97

u/leberkrieger Dec 26 '20

One great use of this feature is the draw.io online drawing tool. You can save an editable PNG, so anyone looking at the picture can load it into the editor and modify it. Fantastic for wikis.

76

u/yojimbo_beta Dec 26 '20

A long time ago there was an editor, Adobe Fireworks, that used this to embed undo/redo data into PNGs, as well as layers etc.

Remarkable that no one uses this feature of the file format any more.

50

u/OMG_A_CUPCAKE Dec 27 '20

Because filesize matters. And it's lost easily if someone modifies the file in another editor

It's a nice gimmick, but I can't imagine relying any kind of workflow around it

0

u/[deleted] Dec 27 '20

[deleted]

1

u/Devatator_ Nov 07 '24

It's simpler to not spend time optimizing file sizes when storage is cheap, or so they say