Skip to content

quasi-coherent/pixelsort

Repository files navigation

pixelsort

OSX release

usage

Full list of options:

pixelsort

Usage: pixelsort --file ARG [--row-min ARG] [--row-max ARG] [--col-min ARG]
                 [--col-max ARG] [--unbroken] [-r] [-g] [-b] [-a] [-M] [-L] [-H]
                 [-N] [-S] [--rand]

Available options:
  -h,--help                Show this help text
  --file ARG               Image to sort
  --row-min INT            Row to start pixel sorting
  --row-max INT            Row to end pixel sorting
  --col-min INT            Column to start pixel sorting
  --col-max INT            Column to end pixel sorting
  --v-par INT              Sort image that is broken into X vertical partitions
  --h-par INT              Sort image that is broken into X horizontal partitions
  -r                       Sort by red
  -g                       Sort by green
  -b                       Sort by blue
  -a                       Sort by alpha
  -M                       Sort by average of pixel values
  -L                       Sort by luminance
  -H                       Sort by hue
  -N                       Sort by norm of the pixels considered as points in
                           4-dimensional space
  -S                       Sort by a step function (with 8 steps) of hue,
                           luminance, and maximum pixel value
  --rand                   Sort by random comparison of pixel properties

With pixelsort somewhere on your path,

pixelsort --file /path/to/image.jpg -r -g -b

will sort the rows of pixels of image.jpg by red, green, blue, respectively, for example, and save the resulting images in the same location as the original (filename being sorted-r-image.jpg, etc.). Applying the --unbroken flag will treat the image as one row instead of contigious rows.

examples

original

hue

luminance

average

opacity

red

green

blue

random

pixelsort -H --chunks 1 --file repo_assets/orig.jpg

unbroken