Media Glitch
A format-aware binary glitch engine (Rust/WASM + Python) that mutates JPEG, PNG, WebP, and GIF bytes while keeping every container structurally valid.

MediaGlitch deliberately corrupts image files into glitch art using a format-aware binary glitch engine, producing controlled visual damage rather than a file that simply fails to open. It ships two implementations sharing the same design — a Rust engine compiled to WebAssembly for a browser app, and a Python prototype/CLI — and currently targets JPEG, PNG, WebP, and GIF.
The core decision is knowing enough about each container format to mutate the right bytes. For JPEG, it mutates entropy-coded scan payload bytes after the SOS marker, leaving headers and markers intact. For PNG, it mutates decompressed scanline payload bytes and then rebuilds the IDAT chunks with valid CRCs, so the file still passes PNG’s own integrity check. WebP, GIF, and unknown formats fall back to a conservative strategy that mutates a protected middle body while leaving headers and tails untouched. A raw-chaos strategy is available for skipping format-awareness entirely and mutating encoded bytes directly, at the cost of files that can become unreadable. Every run is controlled by a seed, an intensity, a pass count, and per-operation weights (bit-flip, byte-noise, xor-span, byte-run, copy-smear, block-swap) bundled into a reusable JSON recipe; walking the seed forward with --variations produces a family of related outputs from one starting recipe.
Status: source local-only. The web app runs the Rust/WASM engine fully client-side; a Python CLI covers the same operations for scripting, and originals are never overwritten unless --in-place is explicitly passed.