A filter that returns 0 for each pixel with a value greater than a specified threshold or the original value otherwise.
- iOS 9.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 9.0+
- Metal Performance Shaders
MPSImage filter converts a single channel image to a binary image. If the input image is not a single channel image, the function first converts the input image into a single channel luminance image using the linear gray color transform, and then it applies the threshold.
Listing 1 shows the threshold to zero inverse function.