Featured
  • Applying transformations to selected colors in an image

    Desaturate a range of colors in an image with a multidimensional lookup table.

    View sample code
  • Calculating the dominant colors in an image

    Find the main colors in an image by implementing k-means clustering using the Accelerate framework.

    View sample code
  • Creating an audio unit extension using the vDSP library

    Add biquadratic filter audio-effect processing to apps like Logic Pro X and GarageBand with the Accelerate framework.

    View sample code
  • Cropping to the subject in a chroma-keyed image

    Convert a chroma-key color to alpha values and trim transparent pixels using Accelerate.

    View sample code
  • Sharing texture data between the Model I/O framework and the vImage library

    Use Model I/O and vImage to composite a photograph over a computer-generated sky.

    View sample code
Audio Processing
  • Creating an audio unit extension using the vDSP library

    Add biquadratic filter audio-effect processing to apps like Logic Pro X and GarageBand with the Accelerate framework.

    View sample code
  • Equalizing Audio with vDSP

    Shape audio output using discrete cosine transforms and biquadratic filters.

    View sample code
Color and Tone Adjustment
  • 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 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 RGB 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
  • Enhancing Image Contrast with Histogram Manipulation

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

    View sample code
  • Specifying Histograms with vImage

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

    View sample code
Compression
  • 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
  • Compressing and Decompressing Files with Stream Compression

    Perform compression or the appropriate kind of decompression to a file based on its path extension.

    View sample code
  • Compressing and Decompressing Files with Swift Stream Compression

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

    View sample code
Conversion Between Image Formats
  • Applying Color Transforms to Images with a Multidimensional Lookup Table

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

    View sample code
  • Building a Basic 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
  • 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
  • Sharing texture data between the Model I/O framework and the vImage library

    Use Model I/O and vImage to composite a photograph over a computer-generated sky.

    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
Convolution and Morphology
  • Adding a Bokeh Effect

    Simulate a bokeh effect by applying dilation.

    View sample code
  • Blurring an Image

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

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

    View sample code
  • Real-Time Video Effects with vImage

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

    View sample code
Directories, Files, and Data Archives
  • 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
  • Compressing File System Directories

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

    View sample code
  • Compressing Single Files

    Compress a single file 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
  • Decompressing Single Files

    Recreate a single file from a compressed file.

    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
  • 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
  • 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
  • Using Windowing with Discrete Fourier Transforms

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

    View sample code
Image Processing Essentials
  • Applying Geometric Transforms to Images

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

    View sample code
  • Applying transformations to selected colors in an image

    Desaturate a range of colors in an image with a multidimensional lookup table.

    View sample code
  • Applying vImage Operations to Regions of Interest

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

    View sample code
  • Building a Basic Image-Processing Workflow

    Resize an image with vImage.

    View sample code
  • 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
  • Creating a Core Graphics Image Format

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

    View sample code
  • Creating a Core Graphics Image from a vImage Buffer

    Create displayable representations of vImage buffers.

    View sample code
  • Creating and Populating Buffers from Core Graphics Images

    Initialize vImage buffers from Core Graphics images.

    View sample code
  • Cropping to the subject in a chroma-keyed image

    Convert a chroma-key color to alpha values and trim transparent pixels using Accelerate.

    View sample code
  • Optimizing Image Processing Performance

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

    View sample code
Image Resampling
  • Reducing Artifacts in Resampled Images

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

    View sample code
Linear Algebra
  • Computing the Mel Spectrum Using Linear Algebra

    Generate a real-time mel spectrogram of audio using matrix multiplication.

    View sample code
  • Denoising an Image Using Linear Algebra

    Reduce noise in an image using singular value decomposition (SVD).

    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
  • Solving Systems of Linear Equations with LAPACK

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

    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
  • 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
Signal Processing Essentials
  • 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
  • Use 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
Sparse Matrices
  • Creating a Sparse Matrix from Coordinate Format Arrays

    Use separate coordinate format arrays to create sparse matrices.

    View sample code
  • 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 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
Vectors, Matrices, and Quaternions
  • 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
  • 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
  • Working with Vectors

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

    View sample code
vImage / vDSP Interoperability
  • Calculating the dominant colors in an image

    Find the main colors in an image by implementing k-means clustering using the Accelerate framework.

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