---
title: "image(with:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiimageasset/image(with:)-8jdwv"
---

# image(with:)

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

## Declaration

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

## Parameters

- `configuration`: The configuration details to use when determining which image to return.

## Return Value

Return Value The image object for the specified configuration.

## Discussion

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

## See Also

### Retrieving an image from an image asset

- [image(with:)](uikit/uiimageasset/image(with:)-3dsgf.md)
