<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NowPlaying",
  "identifier" : "/documentation/NowPlaying/ArtworkRepresentation/init(cgImage:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Now Playing"
    ],
    "preciseIdentifier" : "s:10NowPlaying21ArtworkRepresentationV7cgImageACSo10CGImageRefa_tKcfc"
  },
  "title" : "init(cgImage:)"
}
-->

# init(cgImage:)

Creates an [`ArtworkRepresentation`](/documentation/NowPlaying/ArtworkRepresentation) from a `CGImage` instance.

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

## Parameters

`cgImage`

The `CGImage` that represents the artwork.

## Discussion

If the provided image uses an unsupported format, this initializer returns `nil`.

---

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)