<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImage/init(cgImage:)-14qlb",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIImage(im)initWithCGImage:"
  },
  "title" : "init(cgImage:)"
}
-->

# init(cgImage:)

Initializes and returns the image object with the specified Quartz image reference.

```
init(cgImage: CGImage)
```

## Parameters

`cgImage`

A Quartz image reference.

## Return Value

An initialized `UIImage` object, or `nil` if the method could not initialize the image from the specified data.

---

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)