Image in, corrupted image out.
Glitches that result from corrupted file data.
- JPEG wikipedia https://en.wikipedia.org/wiki/JPEG
- JPEG spec https://www.w3.org/Graphics/JPEG/itu-t81.pdf
- JFIF spec https://www.w3.org/Graphics/JPEG/jfif3.pdf
Current implementation
- find
FFDA
(start of scan) marker in byte stream, two bytes after that are the length, read and skip those - until next marker (
FFxx
, but notFF00
) - skip N bytes, where N random from reasonable range (pay attention to byte stuffing (0xFF00)- overwrite 1 byte with
- slightly different value (e.g. AB->A7)
- random byte (probably nicer/heaver glitch but gets corrupted more easily)
- overwrite 1 byte with
Better implemenation
Read file twice to figure out start and end of scans, then overwrite N evenly distributed bytes, to avoid the "glitch on top and rest of image has bad colors" effect.
No idea if feasible or desirable.
Format-independent artistic interpretations of corrupted data.
- fractal pixelation spots?
- whatever Pony Island does?