Glitch PNG
Create glitch art from PNG images with channel shifts, pixel sorting, scanlines, and data corruption effects. Free browser-based glitch generator.
About
Glitch art exploits data corruption to produce visual artifacts. A standard PNG stores pixel data as rows of R, G, B, A byte quadruplets. This tool reads that buffer, then applies deterministic mutations: horizontal row displacement by ฮx pixels, independent channel offsets (R shifted separately from G and B), rectangular block relocation, and raw byte corruption. Each effect uses a seeded pseudo-random number generator (Mulberry32), so identical seed values reproduce identical output. All processing happens in your browser via the Canvas API. No image data leaves your device.
Naive databending on compressed PNG streams risks producing unreadable files. This tool operates on the decoded pixel buffer, guaranteeing a valid output image every time. The tradeoff: you cannot replicate the accidental artifacts of hex-editing a raw file. For most creative workflows, controlled parametric glitching produces more usable results than blind corruption. Note: very large images (above 4096ร4096) are downscaled to prevent memory issues.
Formulas
The core row-shift operation displaces each pixel row by a random offset. For row y, the new pixel at column x is sampled from:
where W is image width and ฮx is drawn from a uniform distribution [โฮxmax, ฮxmax] only when rand() < intensity.
Channel separation reconstructs each output pixel from three different source locations:
Gout(x, y) = Gsrc(x, y)
Bout(x, y) = Bsrc(x + Bx, y + By)
The green channel remains anchored. Out-of-bounds reads wrap via modulo.
The seeded PRNG uses Mulberry32:
t = imul(t โ (t >>> 15), t | 1)
t = t โ (t + imul(t โ (t >>> 7), t | 61))
return ((t โ (t >>> 14)) >>> 0) รท 232
where s is the seed value. This guarantees identical output for the same seed and parameters.
Byte corruption selects random indices i in the pixel buffer and replaces the value with rand() ร 255, skipping every 4th byte (alpha channel) to preserve opacity.
Reference Data
| Effect | Parameter | Range | Description |
|---|---|---|---|
| Row Shift | intensity | 0 - 100% | Probability that any given row is horizontally displaced |
| Row Shift | ฮxmax | 0 - 200px | Maximum horizontal displacement magnitude |
| Channel Offset | Rx, Ry | โ50 - 50px | Red channel X/Y offset from original position |
| Channel Offset | Bx, By | โ50 - 50px | Blue channel X/Y offset from original position |
| Block Corruption | nblocks | 0 - 50 | Number of rectangular regions randomly relocated |
| Block Corruption | sizemax | 10 - 300px | Maximum width/height of each displaced block |
| Scanlines | gap | 0 - 20px | Vertical spacing between scanline bars (0 = off) |
| Scanlines | ฮฑline | 0 - 1.0 | Opacity of each scanline overlay |
| Byte Corruption | pcorrupt | 0 - 5% | Probability a pixel byte is randomly mutated |
| Color Quantize | bits | 1 - 8 | Bit depth per channel in affected stripes |
| Seed | s | 0 - 999999 | PRNG seed for reproducible results |
| Preset: Subtle | - | - | Low intensity, minimal channel offset, no corruption |
| Preset: VHS | - | - | Moderate row shift, scanlines enabled, slight color bleed |
| Preset: Databend | - | - | Heavy byte corruption, block displacement, quantization |
| Preset: Cyberpunk | - | - | Strong channel separation (R/B), scanlines, high contrast blocks |
| Preset: Corrupted | - | - | Maximum corruption, large block count, aggressive quantization |
| Preset: Vaporwave | - | - | Moderate shifts, heavy channel offset, wide scanline gap |