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

# gaussianGradient()

Generates a gradient that varies from one color to another using a Gaussian distribution.

```
class func gaussianGradient() -> any CIFilter & CIGaussianGradient
```

## Return Value

The generated image.

## Discussion

This method generates a Gaussian gradient image. The effect uses the Gaussian kernel to calculate the even dispersal of the first color in the center to the second color in the image’s periphery.

The Gaussian gradient filter uses the following properties:

- `center`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> representing the center of the effect as x and y coordinates.
- `color0`: A [`CIColor`](/documentation/CoreImage/CIColor) representing the first color to use in the gradient.
- `color1`: A [`CIColor`](/documentation/CoreImage/CIColor) representing the second color to use in the gradient.
- `radius`: A `float` representing the radius of the Gaussian distribution as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that generates a gradient image:

```swift
func gaussian() -> CIImage {
    let gaussianGradient = CIFilter.gaussianGradient()
    gaussianGradient.center = CGPoint (x: 150, y: 150)
    gaussianGradient.color0 = CIColor(red: 88/255, green: 201
/255, blue: 175/255)
    gaussianGradient.color1 = CIColor(red: 153/255, green: 153/255, blue: 204/255)
    gaussianGradient.radius = 10
    return gaussianGradient.outputImage!
}
```

![A photo of a Gaussian gradient that gradually changes in color from purple in the center and shifts to light blue in the periphery.](images/com.apple.coreimage/media-3558795@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)