---
title: "replaceImage(with:)"
framework: paperkit
role: symbol
role_heading: Instance Method
path: "paperkit/imagemarkup/replaceimage(with:)-10qzi"
---

# replaceImage(with:)

Replaces the contents of this image markup with an image file.

## Declaration

```swift
mutating func replaceImage(with url: URL) throws
```

## Parameters

- `url`: The URL of the image file to load and display.

## Discussion

Discussion note: An error if the image file cannot be loaded or is in an unsupported format. Image content is shown scaled to fill.
