<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImage/imageWithData:",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIImage(cm)imageWithData:"
  },
  "title" : "imageWithData:"
}
-->

# imageWithData:

Creates and returns an image object that uses the specified image data.

```
+ (UIImage *) imageWithData:(NSData *) data;
```

## Parameters

`data`

The image data. This can be data from a file or data you create programmatically.

## Return Value

A new image object for the specified data, or `nil` if the method could not initialize the image from the specified data.

## Discussion

This method does not cache the 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)