Glitching PNGs

Originally published at: https://boingboing.net/2019/02/04/glitching-pngs.html

1 Like

Wow, a whole new glitch world, exciting! Also dig the exhaustive approach here.
A couple of years ago I was so giddy when I thought I had “invented” glitch art… only to discover that everything has been done already & better. Sigh. But I refuse to give up :slight_smile:

4 Likes

Neat! But the image attached to the post is presumably not solely the result of PNG glitches, since it seems to have intact chunx of pixels moved around (or swapped from another image), but PNG operates on a pixel-by-pixel level, not on blocks of pixels as with some JPEG and MPEG algorithms. (which is to say, I can tell by the pixels)

3 Likes

You can tell by the macroblocks

5 Likes

shocking but some might…uuuuum

I can’t deny the rainbow colors are pretty, but messing with checksums feels like a bit of a cheat. There is a point at which you’re no longer “glitching” the data but are instead applying an arbitrary random filter, surely?

2 Likes

Here’s some glitch music - I wrote a program to play text as midi sounds, but certain midi instruments didn’t react quite right, sustaining in unpredictable ways. I thought this “mistake” sounded pretty good:

1 Like

It operates on the image as a sequence of pixels rather than blocks, but you can still split that data into multiple chunks to allow partially downloaded images to be displayed incrementally. The image used here does that and then switches the order of some of the chunks.

Several years ago there were some fun security issues for image hosting services related to this. People were storing individual bytes of their payload across several interlaced chunks, then when the server deinterlaced the image to optimize for compression it had the effect of reassembling the malicious code.

1 Like

Are you suuuuure? That which you speak of sounds like progressive JPEG rendering(?), but AFAIK PNG only supports interlacing, where it encodes every Nth line / column, followed by every (N+1)th, etc., so the decoder can display the whole image in increasing detail as it downloads. But the position of pixels is still determined by the order of delivery, so there’s no glitch that can cause correctly-decoded pixels to be drawn in the wrong place, unless there is some enhanced format that allows for that. Or if you’re talking about images split into multiple PNG files.

ETA anyhoo, looking at the mischievous image again, it’s pretty clear the bottom two thirds were just swapped in Pshop before saving the image, since the png_filter_avg glitch is smearing across the boundaries of the swapped bits. I suppose this was considered more humorous

1 Like

The picture is figure B.11 from the gallery, where the author was manipulating(“glitching”) the transpose filter, hence the movement of large swaths of pixels. Poor lena.

1 Like

I seeee. But this “transpose filter” is just something he made up, not part of the PNG spec. He could equally well have written a routine to draw a big old veiny old dong but that wouldn’t mean it was a “glitch” that could happen to a PNG file in nature.

2 Likes

Well, I was, but now that you made me look at the spec I see that storing the interlaced subimages as separate chunks isn’t mandatory. You can have as many image data chunks as you want though, and because each one includes its own CRC they could theoretically be moved around without errors.

I don’t know if that’s what they did here, or if they messed with the data within a chunk and updated the CRC, but it definitely wasn’t done before saving. If it was then there’d be no smearing at all. It’s the introduction of the boundary after encoding that causes the error.

Each pixel is encoded as A-(B+C)/2, where A is the current pixel, B is the one directly above, and C is the one directly to the left. Pixel B changed after encoding, so the stored value can’t be decoded correctly, and then that error propagates down and to the right, regardless of whether everything else is correct, incorrect, or a big floppy manmuscle.

1 Like

It does seem like cheating if transpose isn’t part of the standard toolkit for png. Veiney dong mode may be in there already, but I haven’t checked :wink:

1 Like

Noice!

1 Like

This topic was automatically closed after 5 days. New replies are no longer allowed.