To install png-glitch from source, run the following command:
% cargo install png-glitch --locked png-glitch glitches given PNG file (or directory) and emits the result. By default, it saves to glitched.png.
| Option | Description | Visual Impact |
|---|---|---|
--transpose <N> |
Randomly swaps blocks of scanlines. | Creates horizontal "slicing" and shearing. |
--shift-channels <R,G,B> |
Shifts color channels independently. | Color fringing or radical color shifts. |
--invert |
Inverts all color values. | Classic "negative" look. |
--brighten <N> |
Adjusts brightness (0-255). | Can cause "blown out" or solarized effects. |
--replace <N> |
Replaces pixels with noise (0.0 - 1.0). | Digital "snow" or "static". |
--set-zero <N> |
Sets random pixels to zero (0.0 - 1.0). | Black pixel noise. |
--remove-filter |
Strips all PNG filters before glitching. | Cleans the canvas for more predictable results. |
--sub, --up, --paeth |
Force a specific PNG filter type. | Dramatic vertical or horizontal streaking. |
--seed <N> |
Set a seed for random operations. | Reproducible glitch patterns. |
To glitch multiple images at once, provide a directory as the main argument and use the --batch-output flag:
% png-glitch ./my_images --batch-output ./glitched_results --invert --seed 12345The tool will recursively find all .png files and process them with a progress bar.
You can define complex glitch pipelines in a YAML file:
filters:
- type: RemoveFilter
- type: Invert
- type: Brighten
strength: 30
- type: Transpose
magnitude: 0.1
- type: ChangeFilterType
magnitude: 0.05Run it with:
% png-glitch input.png --config my_glitch.yaml- Developer & Architecture Guide: Deep dive into the internal design and core concepts.
- Spec: Filter System: Technical details on PNG filters.
- Spec: Pixel Formats: How we handle different bit depths and color types.
This repository consists of the following things:
- png-glitch-cli, a binary crate for a command line interface (CLI) to glitch PNG files.
- png-glitch crate, a library to glitch PNG images.
- glitch-context crate, a high-level API to orchestrate glitch filters.
MIT License. Please refer to LICENCE file for details.

