1

Black & white image filter has incorrect calculation for threshold

If I have an image that is admittedly annoyingly bright *, with the DARKEST pixels around rgb(166, 155, 125), the black & white filter results in an all-white image regardless of what threshold I select. So even if threshold is set to 255, which is the maximum, there are no black pixels in the resulting image.

I figured the filter might incorrectly calculate the lightness of each pixel from its components, so I also tried to first filter the image to grayscale, but that also didn't help. But then I'm not sure if the grayscale filter actually changes the image to grayscale colorspace, or just keeps it rgb or rgba, and just sets the components to identical values...

Anyway, what I'd expect is that when the threshold is set to 255, all but pure white pixels in the original image would result in black with this filter. There are many ways to calculate a lightness/brightness/luminance per pixel (by value, perceptually, etc.), but still there seems to be something clearly wrong with the way this filter does it.

* Due to other camera and image manipulation limitations of Tasker