<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSBitmapImageRep/cgImage",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBitmapImageRep(py)CGImage"
  },
  "title" : "cgImage"
}
-->

# cgImage

A Core Graphics image object based on the bitmap image representation’s data.

```
var cgImage: CGImage? { get }
```

## Discussion

The autoreleased <doc://com.apple.documentation/documentation/CoreGraphics/CGImage> opaque type in this property has pixel dimensions that are identical to those of the bitmap image rep object. If an existing <doc://com.apple.documentation/documentation/CoreGraphics/CGImage> opaque type is not available, accessing this property creates a new one. If you change the bitmap image rep’s contents later, accessing this property again might return a different <doc://com.apple.documentation/documentation/CoreGraphics/CGImage> opaque type.

## See Also

[`-  initWithCGImage:`](/documentation/AppKit/NSBitmapImageRep/init(cgImage:)-7o5tz)

Returns a bitmap image representation from a Core Graphics image object.



---

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)