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

# blurredRectangleGenerator()

Generates a blurred rectangle.

```
class func blurredRectangleGenerator() -> any CIFilter & CIBlurredRectangleGenerator
```

## Return Value

A [`CIImage`](/documentation/CoreImage/CIImage) containing a blurred rectangle.

## Discussion

Creates a [`CIImage`](/documentation/CoreImage/CIImage) containing a blurred rectangle. The resulting image size is the extent of the rectangle plus any additional space required for the blur effect.

The blurred rectangle filter uses the following properties:

- `extent`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGRect> that defines the extent of the effect.
- `color`: A [`CIColor`](/documentation/CoreImage/CIColor) specifying the color of the rectangle.
- `sigma`: A `float` specifying the sigma for the Gaussian blur.

The following code creates a filter that generates a blurred red rectangle with a width of 200 x 100 pixels.

```swift
func blurredRectangle() -> CIImage {
    let filter = CIFilter.blurredRectangleGenerator()
    filter.extent = CGRect(x: 0, y: 0, width: 200, height: 100)
    filter.color = CIColor.red
    filter.sigma = 10.0
    return filter.outputImage!
}
```

![An image of a blurred rectangle with an aspect ratio of 2 to 1.](images/com.apple.coreimage/media-4407302@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)