vImage

Manipulate large images using the CPU’s vector processor.

Overview

vImage is a high-performance image processing framework. It includes functions for image manipulation—convolutions, geometric transformations, histogram operations, morphological transformations, and alpha compositing—as well as utility functions for format conversions and other operations.

vImage optimizes image processing by using the CPU’s vector processor. If a vector processor is not available, vImage uses the next best available option. This framework allows you to reap the benefits of vector processors without the need to write vectorized code.

vImage is particularly suited for:

  • Efficiently processing large images

  • Real-time video processing software

  • Scientific applications that require high-accuracy numerical calculations

Topics

First Steps

Creating a Core Graphics Image Format

Provide descriptions of Core Graphics image formats for conversions to and from vImage.

Creating and Populating Buffers from Core Graphics Images

Initialize vImage buffers from Core Graphics images.

Creating a Core Graphics Image from a vImage Buffer

Create displayable representations of vImage buffers.

Applying vImage Operations to Regions of Interest

Limit the effect of vImage operations to rectangular regions of interest.

Swift Overlay

enum vImage

An enumeration that acts as a namespace for Swift overlays to vImage.

vImage Buffers

Optimizing Image Processing Performance

Improve your app's performance by converting image buffer formats from interleaved to planar.

vImage Buffers

Use buffers to pass image data to and from vImage operations.

Core Graphics Interoperability

Core Graphics Interoperability

Pass image data between Core Graphics and vImage.

Core Video Interoperability

Reading From and Writing to Core Video Pixel Buffers

Transfer image data between Core Video pixel buffers and vImage buffers to integrate vImage operations into a Core Image workflow

Applying vImage Operations to Video Sample Buffers

Use vImage’s convert-any-to-any function to perform real-time image processing of video frames streamed from your device’s camera.

Converting Luminance and Chrominance Planes to an ARGB Image

Create a displayable ARGB image from the luminance and chrominance information supplied by your device’s camera.

Real-Time Video Effects with vImage

Use vImage to apply effects to a video feed in real time.

Core Video Interoperability

Pass image data between Core Video and vImage.

vImage Operations

Adjusting the Brightness and Contrast of an Image

Use a gamma function to apply a linear or exponential curve.

Adjusting Saturation and Applying Tone Mapping

Convert an RGB image to discrete luminance and chrominance channels, and apply color and contrast treatments.

Blurring an Image

Filter an image by convolving it with custom and high-speed kernels.

Adding a Bokeh Effect

Simulate a bokeh effect by applying dilation.

Converting Color Images to Grayscale

Convert a color image to grayscale using matrix multiplication.

Standardizing Arbitrary Image Formats for Processing

Convert assets with disparate color spaces and bit depths to a standard working format for applying vImage operations.

Specifying Histograms with vImage

Calculate the histogram of one image and apply it to a second image.

Reducing Artifacts in Resampled Images

Avoid ringing effects introduced by the default Lanczos algorithm when scaling an image by using a custom resampling filter.

Finding the Sharpest Image in a Sequence of Captured Images

Share image data between vDSP and vImage to compute the sharpest image from a bracketed photo sequence.

vImage Operations

Apply image manipulation operations to vImage buffers.