Featured
  • Applying flood fills to an image

    Fill consistently colored connected parts of an image with a new color.

    View sample code
  • Transforming an image in three dimensions

    Fill consistently colored connected parts of an image with a new color.

    View sample code
  • Improving the quality of quantized images with dithering

    Apply dithering to simulate colors that are unavailable in reduced bit depths.

    View sample code
Updated to SwiftUI
  • 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.

    View sample code
  • Equalizing audio with discrete cosine transforms (DCTs)

    Change the frequency response of an audio signal by manipulating frequency-domain data.

    View sample code
  • Halftone descreening with 2D fast Fourier transform

    Reduce or remove periodic artifacts from images.

    View sample code
  • Applying tone curve adjustments to images

    Use the vImage library's polynomial transform to apply tone curve adjustments to images.

    View sample code
  • Adding a bokeh effect to images

    Simulate a bokeh effect by applying dilation.

    View sample code
  • Visualizing sound as an audio spectrogram

    Share image data between vDSP and vImage to visualize audio that a device microphone captures.

    View sample code
  • Adjusting saturation and applying tone mapping

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

    View sample code
  • Blurring an image

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

    View sample code
  • Specifying histograms with vImage

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

    View sample code
  • Adjusting the brightness and contrast of an image

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

    View sample code
  • Adjusting the hue of an image

    Convert an image to L*a*b* color space and apply hue adjustment.

    View sample code
  • Compressing an image using linear algebra

    Reduce the storage size of an image using singular value decomposition (SVD).

    View sample code
  • Reducing artifacts with custom resampling filters

    Implement custom linear interpolation to prevent the ringing effects associated with scaling an image with the default Lanczos algorithm.

    View sample code
  • 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.

    View sample code
  • 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.

    View sample code
  • Integrating vImage pixel buffers into a Core Image workflow

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

    View sample code
  • Compressing and decompressing files with stream compression

    Perform compression for all files and decompression for files with supported extension types.

    View sample code
  • Rotating a cube by transforming its vertices

    Rotate a cube through a series of keyframes using quaternion interpolation to transition between them.

    View sample code
Recently updated
  • Using vImage pixel buffers to generate video effects

    Render real-time video effects with the vImage Pixel Buffer.

    View sample code
  • Optimizing image-processing performance

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

    View sample code
  • Using linear interpolation to construct new data points

    Fill the gaps in arrays of numerical data using linear interpolation.

    View sample code
  • Enhancing image contrast with histogram manipulation

    Enhance and adjust the contrast of an image with histogram equalization and contrast stretching.

    View sample code
  • Solving systems of linear equations with LAPACK

    Select the optimal LAPACK routine to solve a system of linear equations.

    View sample code
  • Applying biquadratic filters to a music loop

    Change the frequency response of an audio signal using a cascaded biquadratic filter.

    View sample code
  • Signal extraction from noise

    Use Accelerate's discrete cosine transform to remove noise from a signal.

    View sample code
  • Finding an interpolating polynomial using the Vandermonde method

    Use LAPACK to solve a linear system and find an interpolating polynomial to construct new points between a series of known data points.

    View sample code
Image Processing Essentials
  • Compositing Images with Alpha Blending

    Combine two images by using alpha blending to create a single output.

    View sample code
  • Compositing Images with vImage Blend Modes

    Combine two images by using blend modes to create a single output.

    View sample code
  • Applying Geometric Transforms to Images

    Reflect, shear, rotate, and scale image buffers using vImage.

    View sample code
  • Applying vImage operations to regions of interest

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

    View sample code
  • Optimizing image-processing performance

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

    View sample code
Convolution and Morphology
  • Blurring an image

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

    View sample code
  • Adding a bokeh effect to images

    Simulate a bokeh effect by applying dilation.

    View sample code
Color and Tone Adjustment
  • Adjusting the brightness and contrast of an image

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

    View sample code
  • Adjusting saturation and applying tone mapping

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

    View sample code
  • Adjusting the hue of an image

    Convert an image to L*a*b* color space and apply hue adjustment.

    View sample code
  • Applying tone curve adjustments to images

    Use the vImage library's polynomial transform to apply tone curve adjustments to images.

    View sample code
  • Specifying histograms with vImage

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

    View sample code
  • Enhancing image contrast with histogram manipulation

    Enhance and adjust the contrast of an image with histogram equalization and contrast stretching.

    View sample code
Conversion Between Image Formats
  • 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

    View sample code
  • Building a basic image conversion workflow

    Learn the fundamentals of the convert-any-to-any function by converting a CMYK image to an RGB image.

    View sample code
  • Converting Color Images to Grayscale

    Convert a color image to grayscale using matrix multiplication.

    View sample code
  • Standardizing Arbitrary Image Formats for Processing

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

    View sample code
  • Applying Color Transforms to Images with a Multidimensional Lookup Table

    Create a multidimensional lookup table to convert RGB images to CMYK.

    View sample code
Image Resampling
  • Reducing artifacts with custom resampling filters

    Implement custom linear interpolation to prevent the ringing effects associated with scaling an image with the default Lanczos algorithm.

    View sample code
Core Video Interoperation
  • Integrating vImage pixel buffers into a Core Image workflow

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

    View sample code
  • 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.

    View sample code
  • Real-Time Video Effects with vImage

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

    View sample code
Signal Processing Essentials
  • Using linear interpolation to construct new data points

    Fill the gaps in arrays of numerical data using linear interpolation.

    View sample code
  • Using vDSP for Vector-based Arithmetic

    Increase the performance of common mathematical tasks with vDSP vector-vector and vector-scalar operations.

    View sample code
  • Controlling vDSP Operations with Stride

    Operate selectively on the elements of a vector at regular intervals.

    View sample code
  • Resampling a Signal with Decimation

    Reduce the sample rate of a signal, by specifying a decimation factor and applying a custom antialiasing filter.

    View sample code
Audio Processing
  • Applying biquadratic filters to a music loop

    Change the frequency response of an audio signal using a cascaded biquadratic filter.

    View sample code
  • Equalizing audio with discrete cosine transforms (DCTs)

    Change the frequency response of an audio signal by manipulating frequency-domain data.

    View sample code
vImage / vDSP Interoperability
  • 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.

    View sample code
  • Visualizing sound as an audio spectrogram

    Share image data between vDSP and vImage to visualize audio that a device microphone captures.

    View sample code
Fourier and Cosine Transforms
  • Data Packing for Fourier Transforms

    Learn how vDSP packs frequency-domain data produced by Fourier transform routines.

    View sample code
  • Halftone descreening with 2D fast Fourier transform

    Reduce or remove periodic artifacts from images.

    View sample code
  • Signal extraction from noise

    Use Accelerate's discrete cosine transform to remove noise from a signal.

    View sample code
  • Finding the Component Frequencies in a Composite Sine Wave

    Use 1D fast Fourier transform to compute the frequency components of a signal.

    View sample code
  • Using Windowing with Discrete Fourier Transforms

    Multiply signal data by window sequence values to reduce spectral leakage.

    View sample code
Neural Networks
  • Training a Neural Network to Recognize Digits

    Build a simple neural network and train it to recognize randomly generated numbers.

    View sample code
Compression
  • Compressing and decompressing files with stream compression

    Perform compression for all files and decompression for files with supported extension types.

    View sample code
  • Compressing and Decompressing Data with Buffer Compression

    Compress a string, write it to the file system, and decompress the same file using buffer compression.

    View sample code
  • Compressing and Decompressing Data with Input and Output Filters

    Compress and decompress streamed or from-memory data, using input and output filters.

    View sample code
Directories, Files, and Data Archives
  • Compressing Single Files

    Compress a single file and store the result on the file system.

    View sample code
  • Compressing File System Directories

    Compress the contents of an entire directory and store the result on the file system.

    View sample code
  • Compresing and Saving a String to the File System

    Compress the contents of a Unicode string and store the result on the file system.

    View sample code
  • Decompressing and Extracting an Archived Directory

    Recreate an entire file system directory from an archive file.

    View sample code
  • Decompressing and Parsing an Archived String

    Recreate a string from an archive file.

    View sample code
Vectors, Matrices, and Quaternions
  • Working with Vectors

    Use vectors to calculate geometric values, calculate dot products and cross products, and interpolate between values.

    View sample code
  • Working with Matrices

    Solve simultaneous equations and transform points in space.

    View sample code
  • Working with Quaternions

    Rotate points around the surface of a sphere, and interpolate between them.

    View sample code
  • Rotating a cube by transforming its vertices

    Rotate a cube through a series of keyframes using quaternion interpolation to transition between them.

    View sample code
Linear Algebra
  • Solving systems of linear equations with LAPACK

    Select the optimal LAPACK routine to solve a system of linear equations.

    View sample code
  • Finding an interpolating polynomial using the Vandermonde method

    Use LAPACK to solve a linear system and find an interpolating polynomial to construct new points between a series of known data points.

    View sample code
Sparse Matrices
  • Creating Sparse Matrices

    Create sparse matrices for factorization and solving systems.

    View sample code
  • Implementing Iterative Methods

    Use iterative methods to solve large problems faster and with a lower memory overhead than with direct methods.

    View sample code
  • Solving Systems Using Direct Methods

    Use direct methods to solve systems of equations where the coefficient matrix is sparse.

    View sample code
  • Solving Systems Using Iterative Methods

    Use iterative methods to solve systems of equations where the coefficient matrix is sparse.

    View sample code
  • Creating a Sparse Matrix from Coordinate Format Arrays

    Use separate coordinate format arrays to create sparse matrices.

    View sample code