<!--
{
  "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/bokehBlur()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)bokehBlurFilter"
  },
  "title" : "bokehBlur()"
}
-->

# bokehBlur()

Applies a bokeh effect to an image.

```
class func bokehBlur() -> any CIFilter & CIBokehBlur
```

## Return Value

The blurred image.

## Discussion

This method applies the bokeh blur filter to an image. The effect targets a circular area of pixels defined by the `radius` and blurs the area. The filter adds smaller intense blur rings.

The bokeh blur filter uses the following properties:

- `radius`: A `float` representing the area of effect as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `ringSize`: A `float` representing the ring size of the bokeh as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `ringAmount`: A `float` representing the emphasis at the ring of the bokeh as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `softness`: A `float` representing the softness of the bokeh effect 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 a softer blur to the input image:

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

        let bokehBlurFilter = CIFilter.bokehBlur()
        bokehBlurFilter.inputImage = inputImage
        bokehBlurFilter.ringSize = 0.1
        bokehBlurFilter.ringAmount = 0
        bokehBlurFilter.softness = 1
        bokehBlurFilter.radius = 20
        return bokehBlurFilter.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 bokeh blur filter has been applied and the image is softer and looks slightly fuzzy or hazy.](images/com.apple.coreimage/media-3544959@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)