<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImage/withConfiguration(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIImage(im)imageWithConfiguration:"
  },
  "title" : "withConfiguration(_:)"
}
-->

# withConfiguration(_:)

Returns a new version of the current image, replacing the current configuration attributes with the specified attributes.

```
func withConfiguration(_ configuration: UIImage.Configuration) -> UIImage
```

## Parameters

`configuration`

The new configuration attributes to associate with the image.

## Return Value

A new version of the image object that contains the specified configuration details.

## Discussion

This method creates a new image object, replacing the image’s current configuration with the values specified in the `configuration` parameter.

---

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)