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

# MPSImageAreaMax

A filter that finds the maximum pixel value in a rectangular region centered around each pixel in the source image.

```
class MPSImageAreaMax
```

## Overview

If there are multiple channels in the source image, each channel is processed independently. The [`edgeMode`](/documentation/MetalPerformanceShaders/MPSUnaryImageKernel/edgeMode) property value is assumed to always be [`MPSImageEdgeMode.clamp`](/documentation/MetalPerformanceShaders/MPSImageEdgeMode/clamp) for this filter.

## Topics

### Initializers

[`init(coder:device:)`](/documentation/MetalPerformanceShaders/MPSImageAreaMax/init(coder:device:))

### Methods

[`init(device:kernelWidth:kernelHeight:)`](/documentation/MetalPerformanceShaders/MPSImageAreaMax/init(device:kernelWidth:kernelHeight:))

Initializes the kernel with a specified width and height.

### Properties

[`kernelHeight`](/documentation/MetalPerformanceShaders/MPSImageAreaMax/kernelHeight)

The height of the filter window. Must be an odd number.

[`kernelWidth`](/documentation/MetalPerformanceShaders/MPSImageAreaMax/kernelWidth)

The width of the filter window. Must be an odd number.



---

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)