This project is intended for use with Python 3 (3.9+ recommended).
- Clone the repo, navigate to the project root folder
- Install the packages below. If using pip for example, you can install everything from the command line via:
- The
__main__.py
script should be able to run now. Upon successfully starting up the GFX generator, you can follow the instructions below.
pip install -r requirements.txt
The following packages should be installed in order to run the generator (these can also be found in the requirements.txt file)
- opencv-python
- numpy
- perlin_noise
- pytest*
- Pillow
- pixelsort**
** The pixelsort package is provided by the pixelsort repo by satyarth - more info on pixel sorting can be found on that repo ;)
- Upon running the main script, a dialog box should pop up to select an image (so far, only jpg and png is supported)
- When an image is selected, the python prompt should show up in the console:
Enter an effect (or x to exit):
- Enter an effect by sending an input of the form:
effect_name/p_key p_value/p_key p_value...
(More detail on the types of available effects can be found below) - When finished, press the x key to exit view the final image. The image should pop up in a new window.
- If you wish to save the image, press the s key, and the dialog box will open for you to save the image. Press any other key otherwise if you don't want to save it. Either option will exit the program.
When applying a new effect, the console input should be of the form:
effect_name/p_key p_value/p_key p_value...
where p_key p_value
can be repeated for as many parameters available, or omitted altogether (will use the default values in that case)
Effect name | Available parameters (p_key) |
noisy | p |
scanlines | or |
scanner | p, or |
highpass | p, k, a |
warp | type, f |
wavy | oct |
burn | p |
pixelsort | or, lower, upper, sortby |
p_key | Meaning | Expected value (p_value) |
p | Percent | float: 0.0 - 1.0 |
or | Orientation | str: 'h' or 'v' |
k | Kernel Size | int: odd number (k%2 = 1) |
a | Amplitude | float: > 0.0 |
type | Warp type | str: {'rotateX', 'rotateY', 'shearX' or 'shearY'} |
f | Factor | int or float (experiment a bit with this one) |
oct | Octaves | int: >= 1 |
sortby | Sorting Algorithm | enum: [lightness, saturation, hue, minimum, intensity] |
lower | Lower Threshold | float: 0.0 - 1.0 and < upper |
upper | Upper Threshold | float: 0.0 - 1.0 and > lower |
The following are examples you can try with the prompt in order to apply effects:
noisy
will apply the noisy filter with the default values (percent of 0.1 in this case)noisy/p 0.7
will apply the noisy filter with a percent value of 0.7scanlines/or v
will apply the scanlines filter with a vertical (v) orientationwarp/type shearY/f 5
will apply the warp filter with a type of shear Y and a factor of 5