<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSImageThresholdBinaryInverse",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSImageThresholdBinaryInverse"
  },
  "title" : "MPSImageThresholdBinaryInverse"
}
-->

# MPSImageThresholdBinaryInverse

A filter that returns 0 for each pixel with a value greater than a specified threshold or a specified value otherwise.

```
class MPSImageThresholdBinaryInverse
```

## Overview

An [`MPSImageThresholdBinaryInverse`](/documentation/MetalPerformanceShaders/MPSImageThresholdBinaryInverse) function 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. The following listing shows the threshold binary inverse function.

Listing 1. Threshold binary inverse function

```other
destinationPixelValue = sourcePixelValue > thresholdValue ? 0 : maximumValue
```

## Topics

### Initializers

[`-  initWithCoder:device:`](/documentation/MetalPerformanceShaders/MPSImageThresholdBinaryInverse/init(coder:device:))

### Methods

[`-  initWithDevice:thresholdValue:maximumValue:linearGrayColorTransform:`](/documentation/MetalPerformanceShaders/MPSImageThresholdBinaryInverse/init(device:thresholdValue:maximumValue:linearGrayColorTransform:))

Initializes the kernel.

### Properties

[`thresholdValue`](/documentation/MetalPerformanceShaders/MPSImageThresholdBinaryInverse/thresholdValue)

The threshold value used to initialize the threshold filter.

[`maximumValue`](/documentation/MetalPerformanceShaders/MPSImageThresholdBinaryInverse/maximumValue)

The maximum value used to initialize the threshold filter.

[`transform`](/documentation/MetalPerformanceShaders/MPSImageThresholdBinaryInverse/transform)

The color transform used to initialize the threshold filter.

## Relationships

### Conforms To

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`MPSUnaryImageKernel`](/documentation/MetalPerformanceShaders/MPSUnaryImageKernel)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)