What is Pixel Sorting?
Tested with python3. Should work with python2 as well.
pip install Pillow should work. If not, see here for details.
There is also a requirements file which pretty much does the same via
pip install -r requirements.txt.
From the command line:
git clone https://github.com/satyarth/pixelsort.git cd pixelsort python3 pixelsort.py %PathToImage% [options]
Tip: To replicate Kim Asendorf's original processing script, first sort vertically and then horizontally in
threshold (default) mode:
python3 pixelsort.py %PathToImage% -a 90 python3 pixelsort.py %PathToSortedImage%
||Controls how the intervals used for sorting are defined. See below for more details and examples.|
||Path of output file. Randomly generates a file name by default.|
||What percentage of intervals not to sort. 0 by default.|
||How dark must a pixel be to be considered as a 'border' for sorting? Takes values from 0-1. 0.25 by default. Used in
||How bright must a pixel be to be considered as a 'border' for sorting? Takes values from 0-1. 0.8 by default. Used in
||Characteristic length for the random width generator. Used in mode
||Angle at which you're pixel sorting in degrees.
|External int file||
||Image used to define intervals. Must be black and white.|
||Sorting function to use for sorting the pixels.|
||Randomly generate intervals. Distribution of widths is linear by default. Interval widths can be scaled using
||Performs an edge detection, which is used to define intervals. Tweak threshold with
||Intervals defined by lightness thresholds; only pixels with a lightness between the upper and lower thresholds are sorted.|
||Intervals are waves of nearly uniform widths. Control width of waves with
||Intervals taken from another specified input image. Must be black and white.|
||Sort whole rows, only stopping at image borders.|
||Sort by the lightness of a pixel according to a HSV representation.|
||Sort by the hue of a pixel according to a HSV representation.|
||Sort by the saturation of a pixel according to a HSV representation.|
||Sort by the intensity of a pixel, i.e. the sum of all the RGB values.|
||Sort on the minimum RGB value of a pixel (either the R, G or B).|
python3 pixelsort.py examples/image.jpg -i random -c 20
python3 pixelsort.py examples/image.jpg -i edges -t 250
file: Intervals taken from image specified with
-f. Must be black and white.
python3 pixelsort.py examples/image.jpg -i file -f examples/intervals.png
(generated with elementary-ca)
- Allow defining different intervals for different channels.