<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIFilter-swift.class/morphologyRectangleMinimum()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)morphologyRectangleMinimumFilter"
  },
  "title" : "morphologyRectangleMinimum()"
}
-->

# morphologyRectangleMinimum()

Blurs a rectangular area by reducing contrasting pixels.

```
class func morphologyRectangleMinimum() -> any CIFilter & CIMorphologyRectangleMinimum
```

## Return Value

The blurred image.

## Discussion

This method applies the morphology rectangle minimum filter to an image. The effect targets a rectangular section of the image, calculating the median color values to find colors that make up more than half the working area. Using this calculation, the effect reduces the pixels with contrasting colors to take up more of the less area. The effect is then repeated throughout the image.

The morphology rectangle minimum filter uses the following properties:

- width: A `float` representing the width in pixels of the working area as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- height: A `float` representing the height in pixels of the working area as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- inputImage: A [`CIImage`](/documentation/CoreImage/CIImage) representing the input image to apply the filter to.

The following code creates a filter that adds an intense blur to the palm trees input image:

```swift
    func morphologyRectangleMinimum(inputImage: CIImage) -> CIImage? {

        let morphologyRectangleMinimumFilter = CIFilter.morphologyRectangleMinimum()
        morphologyRectangleMinimumFilter.inputImage = inputImage
        morphologyRectangleMinimumFilter.width = 5
        morphologyRectangleMinimumFilter.height = 5
        return morphologyRectangleMinimumFilter.outputImage
    }
```

![Two photographs of a beach at sunset with multiple palm trees. The photo on the left is clear and crisp. In the photo on the right, a morphology rectangle minimum blur has been applied, resulting in the image becoming hazy and the palm trees darker and less distinct.](images/com.apple.coreimage/media-3544957@2x.png)

---

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)