<!--
{
  "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/imageWithContentsOfFile:",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIImage(cm)imageWithContentsOfFile:"
  },
  "title" : "imageWithContentsOfFile:"
}
-->

# imageWithContentsOfFile:

Creates and returns an image object by loading the image data from the file at the specified path.

```
+ (UIImage *) imageWithContentsOfFile:(NSString *) path;
```

## Parameters

`path`

The full or partial path to the file.

## Return Value

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

## 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)