<!--
{
  "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/MPSUnaryImageKernel/edgeMode",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSUnaryImageKernel(py)edgeMode"
  },
  "title" : "edgeMode"
}
-->

# edgeMode

The edge mode to use when texture reads stray off the edge of an image.

```
var edgeMode: MPSImageEdgeMode { get set }
```

## Discussion

Most kernel objects can read off the edge of a source image. This can happen because of a negative offset property, because the `offset + clipRect.size` is larger than the source image, or because the filter uses neighboring pixels in its calculations (e.g. convolution filters).

The default value is usually [`MPSImageEdgeMode.zero`](/documentation/MetalPerformanceShaders/MPSImageEdgeMode/zero), but some kernels default to the [`MPSImageEdgeMode.clamp`](/documentation/MetalPerformanceShaders/MPSImageEdgeMode/clamp) value instead if an edge mode of zero is either unsupported or undefined.

---

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)