---
title: "imageWithCGImage:"
framework: coreimage
role: symbol
role_heading: Type Method
path: "coreimage/ciimage/imagewithcgimage:"
---

# imageWithCGImage:

Creates and returns an image object from a Quartz 2D image.

## Declaration

```occ
+ (CIImage *) imageWithCGImage:(CGImageRef) image;
```

## Parameters

- `image`: A Quartz 2D image (doc://com.apple.documentation/documentation/CoreGraphics/CGImage) object. For more information, see https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066 and doc://com.apple.documentation/documentation/CoreGraphics/CGImage.

## Return Value

Return Value An image object initialized with the contents of the Quartz 2D image.

## See Also

### 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)
- [imageWithContentsOfURL:](coreimage/ciimage/imagewithcontentsofurl:.md)
- [init(contentsOf:options:)](coreimage/ciimage/init(contentsof:options:).md)
- [imageWithContentsOfURL:options:](coreimage/ciimage/imagewithcontentsofurl:options:.md)
- [init(cgImage:)](coreimage/ciimage/init(cgimage:)-2kvvb.md)
- [imageWithCGImage:options:](coreimage/ciimage/imagewithcgimage:options:.md)
- [init(cgImage:options:)](coreimage/ciimage/init(cgimage:options:)-8663h.md)
- [imageWithCGImageSource:index:options:](coreimage/ciimage/imagewithcgimagesource:index:options:.md)
- [init(cgImageSource:index:options:)](coreimage/ciimage/init(cgimagesource:index:options:)-e2bz.md)
- [imageWithData:](coreimage/ciimage/imagewithdata:.md)
- [init(data:)](coreimage/ciimage/init(data:).md)
- [imageWithData:options:](coreimage/ciimage/imagewithdata:options:.md)
