A Python CLI tool for sorting pixels in images.
Project description
pixelsort cli
A simple python command line tool for sort pixels in an image. Based on the works of Kim Asendorf.
The script blocks pixels into dark and light areas using a contrast mask. Then it sorts the pixels in a given direction via their luminance.
- You can increase/decrease the contrast by setting the threshold.
- You can also invert the mask to sort the light pixels instead of the dark ones.
Usage
Install
pip install git+https://github.com/Blotz/pixelsort-cli
or
pip install pixelsort-cli
Examples
pixelsort --help
usage: pixelsort [-h] [--threshold THRESHOLD] [--invert INVERT] [--reverse_sorting REVERSE_SORTING] [--output OUTPUT] image_path {up,down,left,right}
Command line tool for sorting pixels
positional arguments:
image_path path to image
{up,down,left,right} direction to sort pixels
options:
-h, --help show this help message and exit
--threshold THRESHOLD
threshold for contrast
--invert INVERT invert the selected area
--reverse_sorting REVERSE_SORTING
reverse the sorting direction
--output OUTPUT path to output file
pixelsort data/mountains.jpg right --threshold 1.2 --invert True --output out.png
License
MIT Ferdinand Theil
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pixelsort-cli-0.1.4.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for pixelsort_cli-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0af5462e619a2b3d3fc32758aab77745b6b01e9cbe2c08ff126b73086c5e795f |
|
MD5 | 03d3806eceb9116ce3510621ff082093 |
|
BLAKE2b-256 | 5c7d8ec568acb7b09cf162812a8288224bce6554dcec7177b2107632667d00f0 |