---
title: "init(cgImage:)"
framework: nowplaying
role: symbol
role_heading: Initializer
path: "nowplaying/artworkrepresentation/init(cgimage:)"
---

# init(cgImage:)

Creates an ArtworkRepresentation from a CGImage instance.

## Declaration

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

## Parameters

- `cgImage`: The CGImage that represents the artwork.

## Discussion

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