Glitch JPG
Glitch JPG images with pixel sorting, channel shift, scanline corruption, and wave distortion. Real-time preview. Download glitched art instantly.
About
JPEG compression relies on 8×8 pixel blocks processed through Discrete Cosine Transform. Databending exploits this structure by corrupting encoded byte sequences between the Start of Scan (SOS, marker 0xFFDA) and End of Image (EOI, marker 0xFFD9). Altering bytes outside this range destroys the file header and renders the image unreadable. This tool operates on decoded pixel data via Canvas getImageData, applying deterministic corruption algorithms: channel displacement shifts R, G, B planes independently, pixel sorting reorders rows by luminance thresholds, and scanline injection inserts random byte blocks into re-encoded JPEG binary. Careless manual hex editing corrupts files irreversibly. The tool preserves structural integrity while maximizing visual distortion.
Results vary based on JPEG quantization tables and image content. High-frequency detail areas (textures, edges) glitch more dramatically than flat color regions. The "Seed" parameter ensures reproducible results. Export at full resolution with no server upload required.
Formulas
Channel shift displaces each color plane independently across the image canvas:
Pixel sorting compares luminance values calculated from the ITU-R BT.601 standard:
Pixels within row are sorted only if their luminance falls in the range Lmin ≤ L ≤ Lmax. Wave distortion applies a sinusoidal horizontal offset per row:
Where A = amplitude in pixels, λ = wavelength in pixels, φ = phase offset. The seeded pseudo-random number generator uses a linear congruential generator: xn+1 = (a ⋅ xn + c) mod m, with a = 1664525, c = 1013904223, m = 232, ensuring reproducible results for a given seed value.
Reference Data
| Glitch Effect | Technique | Visual Result | Intensity Range | Best For |
|---|---|---|---|---|
| Channel Shift | Offset RGB planes by dx, dy pixels | Chromatic aberration, color fringing | 0 - 200 px | Portraits, high-contrast images |
| Pixel Sorting | Sort row pixels by luminance L within threshold | Streaked, melted look | 0 - 255 threshold | Landscapes, skylines |
| Scanline Corruption | Inject random bytes into JPEG SOS data | Blocky artifacts, color smearing | 1 - 500 corruptions | Any JPEG source |
| Chunk Displacement | Shift horizontal pixel bands by random offset | Broken, displaced bands | 0 - 100 px | Text overlays, geometric images |
| Wave Distortion | Sine-wave row displacement: dx = A ⋅ sin(2πy / λ) | Wavy, liquid distortion | Amplitude 0 - 80 px | Abstract art, backgrounds |
| Quantization Smash | Re-encode at quality Q < 10 | Heavy DCT block artifacts | Quality 1 - 15 | Vaporwave aesthetic |
| Color Crush | Reduce color depth per channel to n levels | Posterized, banded gradients | 2 - 32 levels | Gradients, photographs |
| Line Injection | Insert solid/noise scanlines at interval k | CRT/VHS scan lines | Every 2 - 20 rows | Retro aesthetic |
| Bit Shift | Bitwise shift pixel values: v = v << n | Extreme color distortion | 1 - 4 bits | Experimental art |
| Block Shuffle | Randomly swap 8×8 DCT-aligned blocks | Mosaic scrambling | 1 - 50% blocks | Censorship effect, chaos |
| Ghosting | Blend frame with offset copy at α opacity | Motion blur, echo effect | Offset 5 - 50 px | Action photos |
| Inversion Bands | Invert pixel values in random horizontal strips | Negative color bands | 1 - 30 bands | High-contrast images |