---
title: ImagePresentationComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/imagepresentationcomponent
---

# ImagePresentationComponent

A component that supports general image presentation.

## Declaration

```swift
struct ImagePresentationComponent
```

## Overview

Overview ImagePresentationComponent supports the presentation of three different kinds of images in RealityKit: A traditional 2D image. A spatial photo, which is a stereoscopic photo with additional spatial metadata, as captured on iPhone 15 Pro or later and Apple Vision Pro. A spatial scene, which is a 3D image generated from an existing 2D image or photo. To present a 2D image or a spatial photo, create a new ImagePresentationComponent from a local file URL for the existing image, or from an existing CGImageSource. To generate and present a spatial scene from an existing image, create a ImagePresentationComponent.Spatial3DImage from the image; call the generate() method on your new spatial 3D image; then create a new ImagePresentationComponent with init(spatial3DImage:). Viewing modes By default, an ImagePresentationComponent presents its image in a mono viewing mode, regardless of what kind of image you create it with. To request a different viewing mode, set the component’s desiredViewingMode property, and add the component to an entity with the updated value. To discover which viewing modes a component’s image supports, query the component’s availableViewingModes property. The availableViewingModes set always contains mono as an option. When you create this component with a valid spatial photo, the set of available viewing modes also contains spatialStereo and spatialStereoImmersive. If you created the component with a ImagePresentationComponent.Spatial3DImage, and have called the generate() method to generate it, the set of available viewing modes will also contain spatial3D and spatial3DImmersive. note: The component may not present the image with the desiredViewingMode you choose. Query viewingMode to check what viewing mode the component is using.

## Topics

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

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

### Creating a component from a spatial scene

- [ImagePresentationComponent.Spatial3DImage](realitykit/imagepresentationcomponent/spatial3dimage.md)
- [init(spatial3DImage:)](realitykit/imagepresentationcomponent/init(spatial3dimage:).md)

### Setting and discovering viewing modes

- [ImagePresentationComponent.ViewingMode](realitykit/imagepresentationcomponent/viewingmode-swift.struct.md)
- [viewingMode](realitykit/imagepresentationcomponent/viewingmode-swift.property.md)
- [desiredViewingMode](realitykit/imagepresentationcomponent/desiredviewingmode.md)
- [availableViewingModes](realitykit/imagepresentationcomponent/availableviewingmodes.md)
- [supportedViewingModes(for:)](realitykit/imagepresentationcomponent/supportedviewingmodes(for:)-7za1y.md)
- [supportedViewingModes(for:)](realitykit/imagepresentationcomponent/supportedviewingmodes(for:)-7za1y.md)

### Retrieving the current image size

- [screenImageDimension](realitykit/imagepresentationcomponent/screenimagedimension.md)

### Retrieving the current screen mesh size

- [screenHeight](realitykit/imagepresentationcomponent/screenheight.md)
- [presentationScreenSize](realitykit/imagepresentationcomponent/presentationscreensize.md)

### Instance Methods

- [aspectRatio(for:)](realitykit/imagepresentationcomponent/aspectratio(for:).md)

### Type Methods

- [supportedViewingModes(for:)](realitykit/imagepresentationcomponent/supportedviewingmodes(for:).md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)

## See Also

### Visual adjustments

- [HoverEffectComponent](realitykit/hovereffectcomponent.md)
- [BillboardComponent](realitykit/billboardcomponent.md)
- [EnvironmentBlendingComponent](realitykit/environmentblendingcomponent.md)
- [LensDistortionData](realitykit/lensdistortiondata.md)
