---
title: "init(_:orientation:physicalWidth:)"
framework: arkit
role: symbol
role_heading: Initializer
path: "arkit/arreferenceimage/init(_:orientation:physicalwidth:)-8b3bs"
---

# init(_:orientation:physicalWidth:)

Creates a new reference image from a Core Graphics image object.

## Declaration

```swift
init(_ image: CGImage, orientation: CGImagePropertyOrientation, physicalWidth: CGFloat)
```

## Parameters

- `image`: A Core Graphics image object.
- `orientation`: The intended display orientation for the image.
- `physicalWidth`: The real-world width, in meters, of the image.

## Discussion

Discussion To accurately recognize the position and orientation of an image in the AR environment, ARKit must know the image’s physical size. When you call this initializer, ARKit uses the physicalWidth measurement and orientation you provide together with the aspect ratio of the image itself to calculate the physical height. Use the  physicalSize property of the created ARReferenceImage object to retrieve these values. important: ARKit preprocesses reference images before using them for image detection. To provide reference images bundled with your app, create AR Reference Image assets in your Xcode asset catalog, and use the referenceImageSetNamed(_:in:) method to load them.

## See Also

### Creating Reference Images

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