Command line tool for glitching jpg's
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore ignore build/dist folders Nov 11, 2014
LICENSE Initial commit May 17, 2014
README.md ... May 22, 2017
jpglitch.py edits for python 3 May 7, 2017
requirements.txt reqa Nov 11, 2014
setup.py typo fix Nov 11, 2014

README.md

jpglitch

A command line tool to create glitchart from jp[e]g's. The script will save the glitched image.jpg as image_glitched.png bby default. The reason to save the result as png is for stability so the result looks the same on different platforms.

It requires zlib and libjpeg. Refer to the original PIL readme for more info. http://pillow.readthedocs.org/en/latest/original-readme.html

It uses elements of this javascript implementation. https://github.com/snorpey/glitch-canvas/

Installation

You should install it in a virtualenv by running pip install git+https://github.com/Kareeeeem/jpglitch or by cloning the repo and running python setup.py install.

Usage

python jpglitch.py input.jpg

There are a few optional parameters

Flag Description
-a, --amount This determines the hex value that is used to overwrite original values in the image data. Value from 1 to 99
-s, --seed This determines where in the image data the script starts overwriting data. Value from 1 to 99
-i, --iterations This determines how many times the script overwrites data. Value from 1-115
--jpg Normally the script will output to .png for stablity. We're pretty much corrupting files and unstabe jpegs are rendered differently by different platforms/browsers. Png is more stable, but you might want to keep doing stuff to it so use this if you want a jpeg.
-o, --output Specify the output filename. Defaults to originalname_glitched.extension

When the optional parameters are not given it generates random values in the allowed ranges. This is closer to the original purpose. Glitches are technically not engineered but they just happen.

python jpglitch.py -a 70 -s 4 -i 31 --jpg -o garbled_mess.jpg input.jpg

Example

alt text`