To view this content, you need to install Java from java.com

Illustrates using the very low-level LUT routines to accomplish a per-channel "threshold" operation.
Every value less than a given threshold will be converted to 0, every value greater than or equal to the threshold will be converted to 255.
Note that this is different from the THRESHOLD as performed by filter() which is an all-channel operation. filter(THRESHOLD) applies the same 0 or 255 to all three color channels based on whether the maximum value of all channels is above or below the threshold, resulting in black or white output. The operation shown here will separately compare and convert each channel, resulting in black or red/green/blue/yellow/cyan/magenta/white as output.
In that regard, this function is actually more similar to a two-level posterize operation where the division point (the threshold) is adjustable.

Source code: LUT_01_Threshold

Built with Processing