<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.11.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIImage/init(cgLayer:options:)-3p3l3",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImage(im)initWithCGLayer:options:"
  },
  "title" : "init(cgLayer:options:)"
}
-->

# init(cgLayer:options:)

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

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

## Parameters

`layer`

A CGLayer object. For more information see [Quartz 2D Programming Guide](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

The initialized image object.

## See Also

[`+ (CIImage *) imageWithCGLayer:(CGLayerRef) layer options:(NSDictionary<NSString *,id> *) options;`](/documentation/CoreImage/CIImage/imageWithCGLayer:options:)

Creates and returns an image object  from the contents supplied by a `CGLayer` object, using the  specified options.



---

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)