<!--
{
  "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/MPSImageSobel/init(device:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSImageSobel(im)initWithDevice:"
  },
  "title" : "init(device:)"
}
-->

# init(device:)

Initializes a Sobel filter on a given device using the default color transform.

```
convenience init(device: any MTLDevice)
```

## Parameters

`device`

The Metal device the filter will run on.

## Return Value

An initialized Sobel filter object.

## Discussion

The default color transform matrix is an array of 3 floats set to the *BT.601/JPEG* standard: `{0.299f, 0.587f, 0.114f}`.

---

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)