<!--
{
  "availability" : [
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKImage/init(imageData:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKImage(cm)imageWithImageData:"
  },
  "title" : "init(imageData:)"
}
-->

# init(imageData:)

Creates an image with the specified raw image data.

```
convenience init(imageData: Data)
```

## Parameters

`imageData`

A data object containing the image data in its native format. This parameter must not be `nil`.

## Return Value

An initialized `WKImage` object.

## Discussion

Use this method when you already have raw PNG or JPG data and want to use it for an image. Using this method for raw image data is more efficient than creating an image object to encapsulate that 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)