---
title: "init(cgLayer:options:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/ciimage/init(cglayer:options:)-3p3l3"
---

# init(cgLayer:options:)

Initializes an image object  from the contents supplied by a CGLayer object, using the  specified options.

## Declaration

```swift
init(cgLayer layer: CGLayer, options: [CIImageOption : Any]? = nil)
```

## Parameters

- `layer`: A CGLayer 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/CGLayer.
- `options`: A dictionary specifying image options. (See Image Dictionary Keys.)

## Return Value

Return Value The initialized image object.

## See Also

### Deprecated

- [init(cgLayer:)](coreimage/ciimage/init(cglayer:)-2lgo6.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)
