threshold

pixels included or excluded based on brightness

$ pierogis threshold ./input.jpg -u 150 -l 20
thresholded gnome

very chill.

By default, pixels with brightness outside of the thresholds provided become “included”, and pixels within the thresholds become “excluded” (greater than lower, but less than upper). This can be flipped by providing the --inner flag.

By default, included means replaced with white, excluded with black.

sort uses this under the hood.

arg

description

default

valid

-l, --lower-threshold

pixels with intensity below this value are sorted

64

0-255

-u, --upper-threshold

pixels with intensity above this value are sorted

180

0-255

--inner

if provided, pixels between the threshold values are included in the sort

180

flag

--include

hex color to substitute for white

'ffffff'

0-3

--exclude

hex color to substitute for black

'000000'

0-3

See: ThresholdFilling, Threshold