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

# stripesGenerator()

Generates a line of stripes as an image

```
class func stripesGenerator() -> any CIFilter & CIStripesGenerator
```

## Return Value

The generated image.

## Discussion

This method generates a vertical stripped line pattern as an image.

The stripes generator filter uses the following properties:

- `center`: A [`CIVector`](/documentation/CoreImage/CIVector) representing the center of the image.
- `color0`: A [`CIColor`](/documentation/CoreImage/CIColor) representing the stripes color.
- `color1`: A [`CIColor`](/documentation/CoreImage/CIColor) representing the background color.
- `width`: A `float` representing the width of the lines as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `sharpness`: A `float` representing the sharpness of the lines as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that generates a black and white vertical striped image:

```swift
func stripes() -> CIImage {
    let stripesGenerator = CIFilter.stripesGenerator()
    stripesGenerator.center = CGPoint(x: 150, y: 150)
    stripesGenerator.color0 = .white
    stripesGenerator.color1 = .black
    stripesGenerator.width = 80
    stripesGenerator.sharpness = 1
    return stripesGenerator.outputImage!
}
```

![A series of vertical black and white lines repeating the entire image.](images/com.apple.coreimage/media-3590971@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)