---
title: ARReferenceImage
framework: arkit
role: symbol
role_heading: Class
path: arkit/arreferenceimage
---

# ARReferenceImage

A 2D image that you want ARKit to detect in the physical environment.

## Declaration

```swift
class ARReferenceImage
```

## Overview

Overview To accurately detect the position and orientation of a 2D image in the real world, ARKit requires preprocessed image data and knowledge of the image’s real-world dimensions. The ARReferenceImage class encapsulates this information. To enable image detection in an AR session, pass a collection of reference images to your session configuration’s detectionImages property. Typically, you create reference images in your Xcode project’s asset catalog: In your asset catalog, use the Add (+) button to create an AR Resource Group. Drag image files into the resource group to create AR Reference Image entries in the asset catalog. For each reference image, use the Xcode inspector panel to provide the real-world size at which you want ARKit to recognize the image. (You can also provide a descriptive name, which appears as the name property at runtime and can be useful for debugging.)

## Topics

### Loading Reference Images

- [referenceImages(inGroupNamed:bundle:)](arkit/arreferenceimage/referenceimages(ingroupnamed:bundle:).md)

### Examining a Reference Image

- [name](arkit/arreferenceimage/name.md)
- [physicalSize](arkit/arreferenceimage/physicalsize.md)
- [resourceGroupName](arkit/arreferenceimage/resourcegroupname.md)

### Creating Reference Images

- [init(_:orientation:physicalWidth:)](arkit/arreferenceimage/init(_:orientation:physicalwidth:)-8b3bs.md)
- [init(_:orientation:physicalWidth:)](arkit/arreferenceimage/init(_:orientation:physicalwidth:)-ir2z.md)

### Validating Reference Images

- [validate(completionHandler:)](arkit/arreferenceimage/validate(completionhandler:).md)

### Initializers

- [init(CGImage:orientation:physicalWidth:)](arkit/arreferenceimage/init(cgimage:orientation:physicalwidth:).md)
- [init(pixelBuffer:orientation:physicalWidth:)](arkit/arreferenceimage/init(pixelbuffer:orientation:physicalwidth:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Image Detection

- [Tracking and altering images](arkit/tracking-and-altering-images.md)
- [Detecting Images in an AR Experience](arkit/detecting-images-in-an-ar-experience.md)
- [ARImageAnchor](arkit/arimageanchor.md)
