Skip to main content

Working with ImageRef objects

ImageRef is a lightweight image reference type used throughout the Scanbot SDK to represent image data in a unified and effective manner. Additionally, it acts as a universal interface for images that any component of the SDK captures, processes, or returns.

It enables memory efficient Image processing across the SDK and also makes it cross accessible across all the SDKs.

For display, additional processing, or export, the ImageRef can be converted to the specific SDK image type.

The following are some examples of useful operations when working with ImageRef:

Creating ImageRef objects

ImageRef objects can be created from various sources, including UIImage, CMSampleBuffer, encoded buffers, URLs, and file paths.

Create ImageRef from UIImage

ImageRef from UIImage
loading...

Create ImageRef from CMSampleBuffer

ImageRef from CMSampleBuffer
loading...

Create ImageRef from an encoded buffer

ImageRef from encoded buffer
loading...

Create ImageRef using URL

ImageRef from URL
loading...

Create ImageRef using a file path

ImageRef from file path
loading...

Saving ImageRef objects

ImageRef objects can be easily saved to disk. You can specify the desired quality and the encryption options.

Save ImageRef using URL

Saving ImageRef objects using URL
loading...

Save ImageRef using file path

Saving ImageRef objects using file path
loading...

Converting ImageRef to UIImage

Converting ImageRef to UIImage
loading...

Retrieving ImageRef metadata

Retrieving ImageRef metadata
loading...

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license