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

# dither()

Applies randomized noise to produce a processed look.

```
class func dither() -> any CIFilter & CIDither
```

## Return Value

The modified image.

## Discussion

The effect applies a dithering effect to the input image. The effect applies randomized noise to the input image to produce a processed look.

The dither filter uses the following properties:

- `inputImage`: An image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `intensity`: A `float` representing the desired strength of the effect as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that adds desaturation to the input image:

```swift
func dither(inputImage: CIImage) -> CIImage {
    let ditherFilter = CIFilter.dither()
    ditherFilter.inputImage = inputImage
    ditherFilter.intensity = 0.4
    return ditherFilter.outputImage!
}
```

![Two pictures of a pink flower surrounded by foliage. The photo on the left shows a single flower photographed close-up, in focus, with good light and no effects. In the photo on the right, a dither filter is applied, resulting in the image having a worn appearance.](images/com.apple.coreimage/media-3545020@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)