-
Notifications
You must be signed in to change notification settings - Fork 63
Documentation: The commandline script
Welcome to the glitch-this
commandline script docs! Here you will find all the information you need to get glitching, directly from your commandline!
If you don't have the library already, get it on pypi
You can invoke the script using glitch_this [image_path] [glitch_level]
from anywhere, anytime! Once you have the library installed.
Simply pass in the image path and glitch level!
Same as last time, just include the -g
option
Here's some points about the parameters - and what they do!
-
-h
: Shows help text, use this to get used to the parameters!Ex - glitch_this -h`
(OR)
glitch_this -h
-
IMAGE_PATH
: The script needs to know, what file you want to glitchify right?That's exactly what this is for, you supply the full/relative path to the image you want to glitchify.
Remember, the path must exist as an image file.
PNG
,JPEG
,GIF
are certainly preferred.This is also where the output will be stored.
Ex -
glitch_this test.png
(OR)
glitch_this test.png
-
GLITCH_LEVEL
: A number between 0.1 to 10.0 (including both endpoints), signifying how glitched the output image should be.0.1 stands for "you call this glitched?", 10.0 stands for "good luck understanding this one"
You're absolutely free to use floats, but remember, internally they will be converted to int when needed. So floats with maximum of 1-2 decimal places will make a difference in the output. There likely will not be any difference between
1.591
and1.610
, but there will be between1.5
and1.6
my personal favorite is 2 if anyone cares :P
Ex -
glitch_this 2
(OR)
glitch_this 2
So, with all the required parameters in place, this is how the command should look like - glitch_this test.png 2
-
-o
: Specify full/relative path to write the output file intoDefaults to
current_dir/glitched_(src_img_filename)
Ex -
glitch_this -o /home/not_glitched.png test.png 2
The above command, will take
test.png
as input from current working directory, glitch it and save it in/home
with the namenot_glitched.png
-
-f
: Force overwriting existing file. If the output file happens to have the same name as another file in that path, the program will abort without overwriting, unless-f
is includedDefaults to False
Ex -
glitch_this -f test.png 2
-
-c
: If included, the glitched image will have a color offset, more realistic glitching!Ex -
glitch_this -c test.png 2
-
-s
: If included, the glitched image will have scan linesEx -
glitch_this -s test.png 2
-
-g
: If included, the output will be GIFEx -
glitch_this -g test.png 2
-
-sd Seed
: Use a custom seed for the RNG usedThis ensures you generate predictable glitches
Defaults to
None
Ex-
glitch_this -sd 42 test.png 2
-
-fr Frames
: Specify the number of glitched images to be used in GIFDefaults to 23
Ex -
glitch_this -g -fr 10 test.png 2
-
-st Step
: Glitch every step'th frame instead of all framesDefaults to 1, i.e glitch every frame
If included this will glitch every step'th frame, keeping the other frames untouched. There will still be exactly the number of frames specified, either by
-fr Frames
or the default 23Ex -
glitch_this -g -st 2 test.png 2
-
-i Increment
: Increment/Decrement theglitch_amount
by given value after every frame glitchedDefaults to 0.0, i.e
glitch_amount
will stay the same after every frame glitchedYou can use a negative value to decrement it instead!
The input should be a number (integer or floating point) between 0.0 and 10.0 (inclusive) or -0.0 and -10.0 (inclusive)
Ex -
glitch_this -i 1 test.png 2
The above command will start
glitch_amount
at 2 and increment it by 1 every frame glitchedEx -
glitch_this -i -1 test.png 9
The above command will start
glitch_amount
at 9 and decrement it by 1 every frame glitched -
-cy
: Use this ifglitch_amount
should be looped back to 0.1 or 10.0, if it overflows or underflowsDefaults to False, i.e
glitch_amount
will stay at 0.1 or 10.0, instead of getting looped backglitch_amount
will get incremented/decremented if-i Increment
is included, when it gets decremented to or beyond0.0
, it'll be underflowed to or beyond10.0
if-cy
is included. Likewise, when it gets incremented to or beyond10.0
, it'll be overflowed to or beyond0.1
Ex -
glitch_this -i -1 -cy test.png 9
-
-d Duration
: Specify the time (in centiseconds - hundredths of a second), a single frame is visibleDefaults to 200
Ex -
glitch_this -g -d 500 test.png 2
tip : if you want the GIF to be slower, supply a bigger duration value
-
-rd Relative_Duration
: Use a duration relative to the original GIF's durationThis is only used for glitching input GIFs using
-ig
This overrides
-d Duration
Ex-
glitch_this -ig -rd 2 test.gif 2
The resulting glitched GIF from the above command will have a duration (per frame) double the duration of original GIF's duration (per frame)
-
-l Loop_Count
: Specify how many times the output GIF should loopDefaults to 0, i.e infinite loop
Ex -
glitch_this -g -l 10 test.png 2
-
-ig
: Use this when input image is a GIF. Takes an input GIF and outputs a glitched output GIFDefaults to False
Presence
-g
and-f FRAMES
parameters will make no difference if-ig
is specifiedRemember, this is a time consuming process!
Ex (with duration) -
glitch_this -ig -d 500 test.gif 2
That's it! Have fun glitching!