---
title: "init(device:thresholdValue:maximumValue:linearGrayColorTransform:)"
framework: metalperformanceshaders
role: symbol
role_heading: Initializer
path: "metalperformanceshaders/mpsimagethresholdbinary/init(device:thresholdvalue:maximumvalue:lineargraycolortransform:)"
---

# init(device:thresholdValue:maximumValue:linearGrayColorTransform:)

Initializes the kernel.

## Declaration

```swift
init(device: any MTLDevice, thresholdValue: Float, maximumValue: Float, linearGrayColorTransform transform: UnsafePointer<Float>?)
```

## Parameters

- `device`: The Metal device the filter will run on.
- `thresholdValue`: The threshold value to use.
- `maximumValue`: The maximum value to use.
- `transform`: The color transform to use. This matrix is an array of 3 floats that defaults to the BT.601/JPEG standard: {0.299f, 0.587f, 0.114f}

## Return Value

Return Value An initialized kernel object.
