---
title: "init(imageData:)"
framework: watchkit
role: symbol
role_heading: Initializer
path: "watchkit/wkimage/init(imagedata:)"
---

# init(imageData:)

Creates an image with the specified raw image data.

## Declaration

```swift
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

Return Value An initialized WKImage object.

## Discussion

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.

## See Also

### Creating Image Objects

- [init(image:)](watchkit/wkimage/init(image:).md)
- [init(imageName:)](watchkit/wkimage/init(imagename:).md)
