<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImageAsset/image(with:)-8jdwv",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIImageAsset(im)imageWithConfiguration:"
  },
  "title" : "image(with:)"
}
-->

# image(with:)

Retrieves the variant of the image that best matches the specified image configuration details.

```
func image(with configuration: UIImage.Configuration) -> UIImage
```

## Parameters

`configuration`

The configuration details to use when determining which image to return.

## Return Value

The image object for the specified configuration.

## Discussion

If this method can’t locate an image that matches the specified image configuration precisely, it returns the best match available.

---

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)