The Art of PNG Glitch (2015)
ucnv.github.io
ucnv.github.io
Simply inserting an additional NULL for a specific RGB range will cause all channels written after it to become misaligned and will create quite an interesting output image (similar to figure B.14 in the article). I.e. an R component will be written into G's place, G will be written into B's place etc..
It goes along these lines:
for (int i = 0; i < imgHeight; i++) {
for (int j = 0; j < imgWidth; j++) {
RGBTRIPLE triple;
fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
if (triple.rgbtRed == 0xa4 && triple.rgbtGreen == 0x90 && triple.rgbtBlue < 0x77) {
fwrite(&triple, 4, 1, outptr); // an additional NULL is written to ouput
} else {
fwrite(&triple, 3, 1, outptr);
}
}
}And I just realized I meant to play with it "when I got some free time"... three years ago :/
It's great others document and share their entertaining results to lazy lads like me :)
Somehow these PNG glitches feel "natural", just like analog radio noise, unlike the usual artifacts of heavy JPG, MP3 or video compression. Why are some degradations much less annoying than others? When I need to upscale an low-rez image I usually blur it using anisotropic smoothing, then add random noise. It actually looks sharper than the plain Laczoz/Bicubic upscale.
Maybe we need to design new audio/video formats that degrade more "artistically" when there is data loss or insufficient bandwidth. This is less relevant now than it used to be in ~2005. Still, would be an interesting experiment. Is there an encoding that would naturally produce smoothed visuals without sufficient data?
If I have some energy tonight, I will experiment with taking an image array, "deleting" random pixels and filling them with blended neighbors.
If "art is in the eye of the beholder," then an artistic decomposition would provide inconsistent results across populations. It seems more important that the data decompose in a more repeatable and reliable way.
Idea: create a transmission format which creates specific artifacts only in the presence of certain types of interference or failure modes. The format would likely need to created on a situational basis. It seems likely that this has been created, but I've never heard of something like it.
>Is there an encoding that would naturally produce smoothed visuals without sufficient data?
You might enjoy the results of wavelet compression [1]. An image format using wavelet compression is JPEG2000 [2].
[1] https://image.slidesharecdn.com/sjbit-ncp-2013-140401124704-... [2] https://en.wikipedia.org/wiki/Wavelet_transform#Wavelet_comp...
(Though I kind of have a feeling I pushed my project when this article was posted originally! [Edit: ha, yep, I sure did - someone linked the original discussion below])