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

# starShineGenerator()

Generates a star-shine image.

```
class func starShineGenerator() -> any CIFilter & CIStarShineGenerator
```

## Return Value

The generated image.

## Discussion

This method generates a star-shine image. The effect is similar to a supernova effect. You can use this filter to simulate a lens flare.

The star-shine generator filter uses the following properties:

- `center`: A `vector` representing the center of the flare as a <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint>.
- `color`: A color representing the color of the flare as a <doc://com.apple.documentation/documentation/UIKit/UIColor/cgColor>.
- `radius`: A `float` representing the radius of the flare as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `crossScale`: A `float` representing the cross flare size relative to the round central flare as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `crossAngle`: A `float` representing the angle of the flare as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `crossOpacity`: A `float` representing the thickness of the cross opacity as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `crossWidth`: A `float` representing the cross width as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `epsilon`: A `float` representing the epsilon as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code generates a star-shaped silhouette with a black background.

```swift
func starShine() -> CIImage {
    let starShineGenerator = CIFilter.starShineGenerator()
    starShineGenerator.center = CGPoint(x: 150, y: 150)
    starShineGenerator.color = .green
    starShineGenerator.radius = 50
    starShineGenerator.crossScale = 15
    starShineGenerator.crossAngle = 0.60
    starShineGenerator.crossOpacity = -2
    starShineGenerator.crossWidth = 2.5
    starShineGenerator.epsilon = -2.0
    return starShineGenerator.outputImage!
}
```

![A picture of an object that is similar to a square with the corners stretched farther out from the body and a green gradient behind the star shine.](images/com.apple.coreimage/media-3590972@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)