---
title: "init(contentsOf:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/imagepresentationcomponent/init(contentsof:)"
---

# init(contentsOf:)

Creates a new component by loading a monoscopic texture and (if present) a pair of spatial textures from the provided image file URL.

## Declaration

```swift
init(contentsOf url: URL) async throws
```

## Discussion

Discussion note: Throws an error if it is not possible to load even a monoscopic texture from the image file.

## See Also

### Creating a component from a 2D image or spatial photo

- [init(imageSource:)](realitykit/imagepresentationcomponent/init(imagesource:).md)
