---
title: textImageGenerator()
framework: coreimage
role: symbol
role_heading: Type Method
path: coreimage/cifilter-swift.class/textimagegenerator()
---

# textImageGenerator()

Generates a text image.

## Declaration

```swift
class func textImageGenerator() -> any CIFilter & CITextImageGenerator
```

## Return Value

Return Value The generated image.

## Discussion

Discussion This method generates a text image. The effect takes the input string property and the scale factor to scale up the text. You commonly combine this filter with other filters to create a watermark on images. The text image generator filter uses the following properties: The following code creates a filter that generates a string of text as a grayscale image: func textImage(inputText: String) -> CIImage {     let textImageGenerator = CIFilter.textImageGenerator()     textImageGenerator.text = inputText     textImageGenerator.fontName = "Helvetica"     textImageGenerator.fontSize = 25     textImageGenerator.scaleFactor = 4     return textImageGenerator.outputImage! }

## See Also

### Filters

- [attributedTextImageGenerator()](coreimage/cifilter-swift.class/attributedtextimagegenerator().md)
- [aztecCodeGenerator()](coreimage/cifilter-swift.class/azteccodegenerator().md)
- [barcodeGenerator()](coreimage/cifilter-swift.class/barcodegenerator().md)
- [blurredRectangleGenerator()](coreimage/cifilter-swift.class/blurredrectanglegenerator().md)
- [checkerboardGenerator()](coreimage/cifilter-swift.class/checkerboardgenerator().md)
- [code128BarcodeGenerator()](coreimage/cifilter-swift.class/code128barcodegenerator().md)
- [lenticularHaloGenerator()](coreimage/cifilter-swift.class/lenticularhalogenerator().md)
- [meshGenerator()](coreimage/cifilter-swift.class/meshgenerator().md)
- [pdf417BarcodeGenerator()](coreimage/cifilter-swift.class/pdf417barcodegenerator().md)
- [qrCodeGenerator()](coreimage/cifilter-swift.class/qrcodegenerator().md)
- [randomGenerator()](coreimage/cifilter-swift.class/randomgenerator().md)
- [roundedRectangleGenerator()](coreimage/cifilter-swift.class/roundedrectanglegenerator().md)
- [roundedRectangleStrokeGenerator()](coreimage/cifilter-swift.class/roundedrectanglestrokegenerator().md)
- [starShineGenerator()](coreimage/cifilter-swift.class/starshinegenerator().md)
- [stripesGenerator()](coreimage/cifilter-swift.class/stripesgenerator().md)
