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

# init(imageSource:)

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

## Declaration

```swift
init(imageSource: CGImageSource) async throws
```

## Discussion

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

## See Also

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

- [init(contentsOf:)](realitykit/imagepresentationcomponent/init(contentsof:).md)
