Skip to main content

A Python CLI tool for sorting pixels in images.

Project description

pixelsort cli

tests package

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

example 1


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.6.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

pixelsort_cli-0.1.6-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page