<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ImagePresentationComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation26ImagePresentationComponentV"
  },
  "title" : "ImagePresentationComponent"
}
-->

# ImagePresentationComponent

A component that supports general image presentation.

```
struct ImagePresentationComponent
```

## 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`](/documentation/RealityKit/ImagePresentationComponent/Spatial3DImage) from the image;
call the [`generate()`](/documentation/RealityKit/ImagePresentationComponent/Spatial3DImage/generate()) method on your new spatial 3D image;
then create a new `ImagePresentationComponent` with [`init(spatial3DImage:)`](/documentation/RealityKit/ImagePresentationComponent/init(spatial3DImage:)).

### Viewing modes

By default, an `ImagePresentationComponent` presents its image in a [`mono`](/documentation/RealityKit/ImagePresentationComponent/ViewingMode-swift.struct/mono) viewing mode,
regardless of what kind of image you create it with.

To request a different viewing mode,
set the component’s [`desiredViewingMode`](/documentation/RealityKit/ImagePresentationComponent/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`](/documentation/RealityKit/ImagePresentationComponent/availableViewingModes) property.
The [`availableViewingModes`](/documentation/RealityKit/ImagePresentationComponent/availableViewingModes) set always contains [`mono`](/documentation/RealityKit/ImagePresentationComponent/ViewingMode-swift.struct/mono) as an option.

When you create this component with a valid spatial photo,
the set of available viewing modes also contains
[`spatialStereo`](/documentation/RealityKit/ImagePresentationComponent/ViewingMode-swift.struct/spatialStereo) and [`spatialStereoImmersive`](/documentation/RealityKit/ImagePresentationComponent/ViewingMode-swift.struct/spatialStereoImmersive).

If you created the component with a [`ImagePresentationComponent.Spatial3DImage`](/documentation/RealityKit/ImagePresentationComponent/Spatial3DImage),
and have called the [`generate()`](/documentation/RealityKit/ImagePresentationComponent/Spatial3DImage/generate()) method to generate it,
the set of available viewing modes will also contain
[`spatial3D`](/documentation/RealityKit/ImagePresentationComponent/ViewingMode-swift.struct/spatial3D) and [`spatial3DImmersive`](/documentation/RealityKit/ImagePresentationComponent/ViewingMode-swift.struct/spatial3DImmersive).

> Note: The component may not present the image with the ``doc://com.apple.RealityKit/documentation/RealityKit/ImagePresentationComponent/desiredViewingMode`` you choose.
> Query ``doc://com.apple.RealityKit/documentation/RealityKit/ImagePresentationComponent/viewingMode-swift.property`` to check what viewing mode the component is using.

## Topics

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

[`init(contentsOf:)`](/documentation/RealityKit/ImagePresentationComponent/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.

[`init(imageSource:)`](/documentation/RealityKit/ImagePresentationComponent/init(imageSource:))

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

### Creating a component from a spatial scene

[`Spatial3DImage`](/documentation/RealityKit/ImagePresentationComponent/Spatial3DImage)

A 3D spatial scene created from a 2D image.

[`init(spatial3DImage:)`](/documentation/RealityKit/ImagePresentationComponent/init(spatial3DImage:))

Creates a new image presentation component to present a spatial 3D image.

### Setting and discovering viewing modes

[`ViewingMode`](/documentation/RealityKit/ImagePresentationComponent/ViewingMode-swift.struct)

Image content’s rendering mode.

[`viewingMode`](/documentation/RealityKit/ImagePresentationComponent/viewingMode-swift.property)

The currently active viewing mode of the presented image.

[`desiredViewingMode`](/documentation/RealityKit/ImagePresentationComponent/desiredViewingMode)

The user-selected preferred content viewing mode.

[`availableViewingModes`](/documentation/RealityKit/ImagePresentationComponent/availableViewingModes)

The currently valid viewing modes for the image being presented.

[`supportedViewingModes(for:)`](/documentation/RealityKit/ImagePresentationComponent/supportedViewingModes(for:)-7za1y)

The viewing modes supported by the provided image source.

[`supportedViewingModes(for:)`](/documentation/RealityKit/ImagePresentationComponent/supportedViewingModes(for:)-7za1y)

The viewing modes supported by the provided image source.

### Retrieving the current image size

[`screenImageDimension`](/documentation/RealityKit/ImagePresentationComponent/screenImageDimension)

The image resolution of the currently presented image, in pixels.

### Retrieving the current screen mesh size

[`screenHeight`](/documentation/RealityKit/ImagePresentationComponent/screenHeight)

The height of the screen mesh, in meters, when the image is presented in a non-immersive viewing mode.

[`presentationScreenSize`](/documentation/RealityKit/ImagePresentationComponent/presentationScreenSize)

The size of the screen presenting the image,
with the format [width, height] in meters.

## Relationships

### Conforms To

[`Component`](/documentation/RealityKit/Component)

---

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)