Method Image.Image()->threshold()


Method threshold

object threshold()
object threshold(int level)
object threshold(int r, int g, int b)
object threshold(Color color)

Description

Makes a black-white image.

If any of red, green, blue parts of a pixel is larger then the given value, the pixel will become white, else black.

This method works fine with the grey method.

If no arguments are given, it will paint all non-black pixels white. (Ie, default is 0,0,0.)

original ->threshold(100); ->threshold(0,100,0);

Returns

the new image object

Note

The above statement "any ..." was changed from "all ..." in Pike 0.7 (9906). It also uses 0,0,0 as default input, instead of current color. This is more useful.

See also

grey