---
title: CIImage
framework: coreimage
role: symbol
role_heading: Class
path: coreimage/ciimage
---

# CIImage

A representation of an image to be processed or produced by Core Image filters.

## Declaration

```swift
class CIImage
```

## Mentioned in

Processing an Image Using Built-in Filters Selectively Focusing on an Image Customizing Image Transitions

## Overview

Overview You use CIImage objects in conjunction with other Core Image classes—such as CIFilter, CIContext, CIVector, and CIColor—to take advantage of the built-in Core Image filters when processing images. You can create CIImage objects with data supplied from a variety of sources, including Quartz 2D images, Core Video image buffers (CVImageBuffer), URL-based objects, and NSData objects. Although a CIImage object has image data associated with it, it is not an image. You can think of a CIImage object as an image “recipe.” A CIImage object has all the information necessary to produce an image, but Core Image doesn’t actually render an image until it is told to do so. This lazy evaluation allows Core Image to operate as efficiently as possible. To show a CIImage object as an on-screen image, you can display it as a UIImage in UIImageView: CIContext  and CIImage objects are immutable, which means each can be shared safely among threads. Multiple threads can use the same GPU or CPU CIContext object to render CIImage objects.  However, this is not the case for CIFilter objects, which are mutable. A CIFilter object cannot be shared safely among threads.  If you app is multithreaded, each thread must create its own CIFilter objects. Otherwise, your app could behave unexpectedly. Core Image also provides auto-adjustment methods. These methods analyze an image for common deficiencies and return a set of filters to correct those deficiencies. The filters are preset with values for improving image quality by altering values for skin tones, saturation, contrast, and shadows and for removing red-eye or other artifacts caused by flash. (See Getting Autoadjustment Filters.) For a discussion of all the methods you can use to create CIImage objects on iOS and macOS, see Core Image Programming Guide.

## Topics

### Creating an Image

- [empty()](coreimage/ciimage/empty().md)
- [init(image:)](coreimage/ciimage/init(image:).md)
- [init(image:options:)](coreimage/ciimage/init(image:options:).md)
- [init(contentsOf:)](coreimage/ciimage/init(contentsof:).md)
- [init(contentsOf:options:)](coreimage/ciimage/init(contentsof:options:).md)
- [init(cgImage:)](coreimage/ciimage/init(cgimage:)-2kvvb.md)
- [init(cgImage:options:)](coreimage/ciimage/init(cgimage:options:)-8663h.md)
- [init(cgImageSource:index:options:)](coreimage/ciimage/init(cgimagesource:index:options:)-e2bz.md)
- [init(data:)](coreimage/ciimage/init(data:).md)
- [init(data:options:)](coreimage/ciimage/init(data:options:).md)
- [init(bitmapData:bytesPerRow:size:format:colorSpace:)](coreimage/ciimage/init(bitmapdata:bytesperrow:size:format:colorspace:).md)
- [init(bitmapImageRep:)](coreimage/ciimage/init(bitmapimagerep:).md)
- [init(imageProvider:size:_:format:colorSpace:options:)](coreimage/ciimage/init(imageprovider:size:_:format:colorspace:options:).md)
- [init(depthData:)](coreimage/ciimage/init(depthdata:).md)
- [init(depthData:options:)](coreimage/ciimage/init(depthdata:options:).md)
- [init(portaitEffectsMatte:)](coreimage/ciimage/init(portaiteffectsmatte:).md)
- [init(portaitEffectsMatte:options:)](coreimage/ciimage/init(portaiteffectsmatte:options:).md)
- [init(semanticSegmentationMatte:)](coreimage/ciimage/init(semanticsegmentationmatte:).md)
- [init(semanticSegmentationMatte:options:)](coreimage/ciimage/init(semanticsegmentationmatte:options:).md)
- [init(cvImageBuffer:)](coreimage/ciimage/init(cvimagebuffer:)-7wmzq.md)
- [init(cvImageBuffer:options:)](coreimage/ciimage/init(cvimagebuffer:options:)-8upim.md)
- [init(cvPixelBuffer:)](coreimage/ciimage/init(cvpixelbuffer:)-3wng7.md)
- [init(cvPixelBuffer:options:)](coreimage/ciimage/init(cvpixelbuffer:options:)-9x2pz.md)
- [init(mtlTexture:options:)](coreimage/ciimage/init(mtltexture:options:)-67uvj.md)
- [init(ioSurface:)](coreimage/ciimage/init(iosurface:)-5e9yc.md)
- [init(ioSurface:options:)](coreimage/ciimage/init(iosurface:options:)-48cta.md)

### Creating an Image by Modifying an Existing Image

- [applyingFilter(_:parameters:)](coreimage/ciimage/applyingfilter(_:parameters:).md)
- [applyingFilter(_:)](coreimage/ciimage/applyingfilter(_:).md)
- [transformed(by:)](coreimage/ciimage/transformed(by:).md)
- [transformed(by:highQualityDownsample:)](coreimage/ciimage/transformed(by:highqualitydownsample:).md)
- [cropped(to:)](coreimage/ciimage/cropped(to:).md)
- [oriented(forExifOrientation:)](coreimage/ciimage/oriented(forexiforientation:).md)
- [clampedToExtent()](coreimage/ciimage/clampedtoextent().md)
- [clamped(to:)](coreimage/ciimage/clamped(to:).md)
- [composited(over:)](coreimage/ciimage/composited(over:).md)
- [convertingWorkingSpaceToLab()](coreimage/ciimage/convertingworkingspacetolab().md)
- [convertingLabToWorkingSpace()](coreimage/ciimage/convertinglabtoworkingspace().md)
- [matchedToWorkingSpace(from:)](coreimage/ciimage/matchedtoworkingspace(from:).md)
- [matchedFromWorkingSpace(to:)](coreimage/ciimage/matchedfromworkingspace(to:).md)
- [premultiplyingAlpha()](coreimage/ciimage/premultiplyingalpha().md)
- [unpremultiplyingAlpha()](coreimage/ciimage/unpremultiplyingalpha().md)
- [settingAlphaOne(in:)](coreimage/ciimage/settingalphaone(in:).md)
- [applyingGaussianBlur(sigma:)](coreimage/ciimage/applyinggaussianblur(sigma:).md)
- [settingProperties(_:)](coreimage/ciimage/settingproperties(_:).md)
- [insertingIntermediate()](coreimage/ciimage/insertingintermediate().md)
- [insertingIntermediate(cache:)](coreimage/ciimage/insertingintermediate(cache:).md)

### Creating Solid Colors

- [init(color:)](coreimage/ciimage/init(color:).md)
- [black](coreimage/ciimage/black.md)
- [blue](coreimage/ciimage/blue.md)
- [clear](coreimage/ciimage/clear.md)
- [cyan](coreimage/ciimage/cyan.md)
- [gray](coreimage/ciimage/gray.md)
- [green](coreimage/ciimage/green.md)
- [magenta](coreimage/ciimage/magenta.md)
- [red](coreimage/ciimage/red.md)
- [white](coreimage/ciimage/white.md)
- [yellow](coreimage/ciimage/yellow.md)

### Getting Image Information

- [definition](coreimage/ciimage/definition.md)
- [extent](coreimage/ciimage/extent.md)
- [properties](coreimage/ciimage/properties.md)
- [url](coreimage/ciimage/url.md)
- [colorSpace](coreimage/ciimage/colorspace.md)
- [orientationTransform(forExifOrientation:)](coreimage/ciimage/orientationtransform(forexiforientation:).md)

### Drawing Images

- [draw(at:from:operation:fraction:)](coreimage/ciimage/draw(at:from:operation:fraction:).md)
- [draw(in:from:operation:fraction:)](coreimage/ciimage/draw(in:from:operation:fraction:).md)

### Getting Autoadjustment Filters

- [autoAdjustmentFilters()](coreimage/ciimage/autoadjustmentfilters().md)
- [autoAdjustmentFilters(options:)](coreimage/ciimage/autoadjustmentfilters(options:).md)
- [Autoadjustment Keys](coreimage/autoadjustment-keys.md)

### Working with Filter Regions of Interest

- [regionOfInterest(for:in:)](coreimage/ciimage/regionofinterest(for:in:).md)

### Working with Orientation

- [oriented(_:)](coreimage/ciimage/oriented(_:).md)
- [orientationTransform(for:)](coreimage/ciimage/orientationtransform(for:).md)

### Sampling the Image

- [samplingNearest()](coreimage/ciimage/samplingnearest().md)
- [samplingLinear()](coreimage/ciimage/samplinglinear().md)

### Accessing Original Image Content

- [cgImage](coreimage/ciimage/cgimage.md)
- [pixelBuffer](coreimage/ciimage/pixelbuffer.md)
- [depthData](coreimage/ciimage/depthdata.md)
- [portraitEffectsMatte](coreimage/ciimage/portraiteffectsmatte.md)
- [semanticSegmentationMatte](coreimage/ciimage/semanticsegmentationmatte.md)

### Image Dictionary Keys

- [CIImageOption](coreimage/ciimageoption.md)

### AutoAdjustment Keys

- [CIImageAutoAdjustmentOption](coreimage/ciimageautoadjustmentoption.md)

### Deprecated

- [init(cgLayer:)](coreimage/ciimage/init(cglayer:)-2lgo6.md)
- [init(cgLayer:options:)](coreimage/ciimage/init(cglayer:options:)-3p3l3.md)
- [init(texture:size:flipped:colorSpace:)](coreimage/ciimage/init(texture:size:flipped:colorspace:).md)
- [init(texture:size:flipped:options:)](coreimage/ciimage/init(texture:size:flipped:options:).md)
- [init(ioSurface:plane:format:options:)](coreimage/ciimage/init(iosurface:plane:format:options:)-93isn.md)
- [textureTarget](coreimage/ciimageoption/texturetarget.md)
- [textureFormat](coreimage/ciimageoption/textureformat.md)

### Instance Properties

- [contentHeadroom](coreimage/ciimage/contentheadroom.md)
- [isOpaque](coreimage/ciimage/isopaque.md)
- [metalTexture](coreimage/ciimage/metaltexture.md)
- [contentAverageLightLevel](coreimage/ciimage/contentaveragelightlevel.md)

### Instance Methods

- [applyingGainMap(_:)](coreimage/ciimage/applyinggainmap(_:).md)
- [applyingGainMap(_:headroom:)](coreimage/ciimage/applyinggainmap(_:headroom:).md)
- [insertingTiledIntermediate()](coreimage/ciimage/insertingtiledintermediate().md)
- [settingContentAverageLightLevel(_:)](coreimage/ciimage/settingcontentaveragelightlevel(_:).md)
- [settingContentHeadroom(_:)](coreimage/ciimage/settingcontentheadroom(_:).md)

### Initializers

- [init(CGImage:)](coreimage/ciimage/init(cgimage:)-5vlch.md)
- [init(CGImage:)](coreimage/ciimage/init(cgimage:)-8cm8a.md)
- [init(CGImage:options:)](coreimage/ciimage/init(cgimage:options:)-1ksqh.md)
- [init(CGImage:options:)](coreimage/ciimage/init(cgimage:options:)-28wtj.md)
- [init(CGImageSource:index:options:)](coreimage/ciimage/init(cgimagesource:index:options:)-2dium.md)
- [init(CGImageSource:index:options:)](coreimage/ciimage/init(cgimagesource:index:options:)-4b3fz.md)
- [init(CGLayer:)](coreimage/ciimage/init(cglayer:)-3wseb.md)
- [init(CGLayer:)](coreimage/ciimage/init(cglayer:)-8o853.md)
- [init(CGLayer:options:)](coreimage/ciimage/init(cglayer:options:)-34jjk.md)
- [init(CGLayer:options:)](coreimage/ciimage/init(cglayer:options:)-8su8t.md)
- [init(CVImageBuffer:)](coreimage/ciimage/init(cvimagebuffer:)-6k44w.md)
- [init(CVImageBuffer:)](coreimage/ciimage/init(cvimagebuffer:)-9fq4l.md)
- [init(CVImageBuffer:options:)](coreimage/ciimage/init(cvimagebuffer:options:)-79c2d.md)
- [init(CVImageBuffer:options:)](coreimage/ciimage/init(cvimagebuffer:options:)-7g0yo.md)
- [init(CVPixelBuffer:)](coreimage/ciimage/init(cvpixelbuffer:)-1z0mw.md)
- [init(CVPixelBuffer:)](coreimage/ciimage/init(cvpixelbuffer:)-5p2mz.md)
- [init(CVPixelBuffer:options:)](coreimage/ciimage/init(cvpixelbuffer:options:)-6rkzb.md)
- [init(CVPixelBuffer:options:)](coreimage/ciimage/init(cvpixelbuffer:options:)-8i44g.md)
- [init(IOSurface:)](coreimage/ciimage/init(iosurface:)-72me3.md)
- [init(IOSurface:)](coreimage/ciimage/init(iosurface:)-7dwj8.md)
- [init(IOSurface:options:)](coreimage/ciimage/init(iosurface:options:)-4dwl5.md)
- [init(IOSurface:options:)](coreimage/ciimage/init(iosurface:options:)-7qdsg.md)
- [init(IOSurface:plane:format:options:)](coreimage/ciimage/init(iosurface:plane:format:options:)-7k35r.md)
- [init(MTLTexture:options:)](coreimage/ciimage/init(mtltexture:options:)-510vm.md)
- [init(MTLTexture:options:)](coreimage/ciimage/init(mtltexture:options:)-5ou1j.md)
- [init(coder:)](coreimage/ciimage/init(coder:).md)
- [init(contentsOfURL:)](coreimage/ciimage/init(contentsofurl:)-1e9r3.md)
- [init(contentsOfURL:)](coreimage/ciimage/init(contentsofurl:)-9vlbb.md)
- [init(contentsOfURL:options:)](coreimage/ciimage/init(contentsofurl:options:)-7g3lx.md)
- [init(contentsOfURL:options:)](coreimage/ciimage/init(contentsofurl:options:)-93guu.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [AttachableAsImage](testing/attachableasimage.md)
- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Essentials

- [Processing an Image Using Built-in Filters](coreimage/processing-an-image-using-built-in-filters.md)
- [CIContext](coreimage/cicontext.md)
