<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/applying-color-transforms-to-pixel-buffers",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Applying color transforms to pixel buffers"
}
-->

# Applying color transforms to pixel buffers

Adjust the colors of an image by applying gamma, polynomials, or multidimensional lookup.

## Topics

### Applying gamma

[`func applyGamma(vImage.Gamma, intermediateBuffer: vImage.PixelBuffer<vImage.PlanarF>?, destination: vImage.PixelBuffer<vImage.Planar8>)`](/documentation/Accelerate/vImage/PixelBuffer/applyGamma(_:intermediateBuffer:destination:)-1fif9)

Applies a gamma function to an 8-bit planar pixel buffer.

[`func applyGamma(vImage.Gamma, intermediateBuffer: vImage.PixelBuffer<vImage.InterleavedFx2>?, destination: vImage.PixelBuffer<vImage.Interleaved8x2>)`](/documentation/Accelerate/vImage/PixelBuffer/applyGamma(_:intermediateBuffer:destination:)-390k5)

Applies a gamma function to an 8-bit-per-channel, 2-channel interleaved pixel buffer.

[`func applyGamma(vImage.Gamma, intermediateBuffer: vImage.PixelBuffer<vImage.InterleavedFx3>?, destination: vImage.PixelBuffer<vImage.Interleaved8x3>)`](/documentation/Accelerate/vImage/PixelBuffer/applyGamma(_:intermediateBuffer:destination:)-3yu0w)

Applies a gamma function to an 8-bit-per-channel, 3-channel interleaved pixel buffer.

[`func applyGamma(vImage.Gamma, intermediateBuffer: vImage.PixelBuffer<vImage.InterleavedFx4>?, destination: vImage.PixelBuffer<vImage.Interleaved8x4>)`](/documentation/Accelerate/vImage/PixelBuffer/applyGamma(_:intermediateBuffer:destination:)-wsww)

Applies a gamma function to an 8-bit-per-channel, 4-channel interleaved pixel buffer.

[`func applyGamma(vImage.Gamma, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/applyGamma(_:destination:))

Applies a gamma function to a 32-bit pixel buffer.

[`enum Gamma`](/documentation/Accelerate/vImage/Gamma)

Describes either a used-defined or constant gamma.

### Applying piecewise gamma

[`func applyGamma(linearParameters: (scale: Float, bias: Float), exponentialParameters: (scale: Float, preBias: Float, gamma: Float, postBias: Float), boundary: Pixel_8, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/applyGamma(linearParameters:exponentialParameters:boundary:destination:)-249w5)

Applies a piecewise gamma calculation to an 8-bit pixel buffer.

[`func applyGamma(linearParameters: (scale: Float, bias: Float), exponentialParameters: (scale: Float, preBias: Float, gamma: Float, postBias: Float), boundary: Float, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/applyGamma(linearParameters:exponentialParameters:boundary:destination:)-8r0ro)

Applies a piecewise gamma calculation to a 32-bit pixel buffer.

### Appying polynomial (32-bit source, 8-bit destination)

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.Planar8>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-3b0d0)

Applies a set of piecewise polynomials to a 32-bit planar buffer and writes the result to an 8-bit planar buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.Interleaved8x2>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-6uls3)

Applies a set of piecewise polynomials to a 2-channel, 32-bit interleaved buffer and writes the result to a 2-channel, 8-bit interleaved buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.Interleaved8x3>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-4r6nf)

Applies a set of piecewise polynomials to a 3-channel, 32-bit interleaved buffer and writes the result to a 3-channel, 8-bit interleaved buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.Interleaved8x4>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-1b2nu)

Applies a set of piecewise polynomials to a 4-channel, 32-bit interleaved buffer and writes the result to a 4-channel, 8-bit interleaved buffer.

### Appying polynomial (8-bit source, 32-bit destination)

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.PlanarF>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-7sy2t)

Applies a set of piecewise polynomials to an 8-bit planar buffer and writes the result to a 32-bit planar buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.InterleavedFx2>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-3sxxv)

Applies a set of piecewise polynomials to a 2-channel, 8-bit interleaved buffer and writes the result to a 2-channel, 32-bit interleaved buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.InterleavedFx3>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-4o5ju)

Applies a set of piecewise polynomials to a 3-channel, 8-bit interleaved buffer and writes the result to a 3-channel, 32-bit interleaved buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<vImage.InterleavedFx4>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-6ohrj)

Applies a set of piecewise polynomials to a 4-channel, 8-bit interleaved buffer and writes the result to a 4-channel, 32-bit interleaved buffer.

### Appying polynomial (32-bit)

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-3c46t)

Applies a set of piecewise polynomials to a 32-bit planar buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-8f5i9)

Applies a set of piecewise polynomials to a 2-channel, 32-bit interleaved buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-26zom)

Applies a set of piecewise polynomials to a 3-channel, 32-bit interleaved buffer.

[`func applyPolynomial(coefficientSegments: [[Float]], boundaries: [Float], destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/applyPolynomial(coefficientSegments:boundaries:destination:)-8uesn)

Applies a set of piecewise polynomials to a 4-channel, 32-bit interleaved buffer.

### Transforming with a lookup table

[`func applyLookup([Pixel_8], destination: vImage.PixelBuffer<vImage.Planar8>)`](/documentation/Accelerate/vImage/PixelBuffer/applyLookup(_:destination:)-5r7bq)

Applies a lookup table to transform an 8-bit planar image.

[`func applyLookup([Pixel_F], destination: vImage.PixelBuffer<vImage.PlanarF>)`](/documentation/Accelerate/vImage/PixelBuffer/applyLookup(_:destination:)-14pjo)

Applies a lookup table to transform an 8-bit planar image to a 32-bit planar image.

[`func applyLookup([Pixel_16U], destination: vImage.PixelBuffer<vImage.Planar16U>)`](/documentation/Accelerate/vImage/PixelBuffer/applyLookup(_:destination:)-5oi4o)

Applies a lookup table to transform an 8-bit planar image to a 16-bit planar image.

[`func applyLookup([Pixel_8888], destination: vImage.PixelBuffer<vImage.Interleaved8x3>)`](/documentation/Accelerate/vImage/PixelBuffer/applyLookup(_:destination:)-3ruls)

Applies a lookup table to transform an 8-bit planar image to an 8-bit-per-channel, three-channel interleaved image.

[`func applyLookup([Pixel_FFFF], destination: vImage.PixelBuffer<vImage.InterleavedFx3>)`](/documentation/Accelerate/vImage/PixelBuffer/applyLookup(_:destination:)-1tsb5)

Applies a lookup table to transform an 8-bit planar image to a 32-bit-per-channel, three-channel interleaved image.

[`func applyLookup(alphaTable: [Pixel_8]?, redTable: [Pixel_8]?, greenTable: [Pixel_8]?, blueTable: [Pixel_8]?, destination: vImage.PixelBuffer<vImage.Interleaved8x4>)`](/documentation/Accelerate/vImage/PixelBuffer/applyLookup(alphaTable:redTable:greenTable:blueTable:destination:))

Applies a set of four lookup tables to transform an interleaved, four-channel 8-bit image.

### Transforming with a multidimensional lookup table

[`struct MultidimensionalLookupTable`](/documentation/Accelerate/vImage/MultidimensionalLookupTable)

A multidimensional lookup table.

### Applying a flood fill to an image

[`func floodFill(from: CGPoint, newColor: Pixel_8, connectivity: vImage.FloodFillConnectivity)`](/documentation/Accelerate/vImage/PixelBuffer/floodFill(from:newColor:connectivity:)-44z7t)

Applies an in-place flood-fill operation to the 8-bit planar image.

[`func floodFill(from: CGPoint, newColor: Pixel_8888, connectivity: vImage.FloodFillConnectivity)`](/documentation/Accelerate/vImage/PixelBuffer/floodFill(from:newColor:connectivity:)-56w4b)

Applies an in-place flood-fill operation to the interleaved 4-channel, 8-bit-per-pixel image.

[`func floodFill(from: CGPoint, newColor: Pixel_16U, connectivity: vImage.FloodFillConnectivity)`](/documentation/Accelerate/vImage/PixelBuffer/floodFill(from:newColor:connectivity:)-219lg)

Applies an in-place flood-fill operation to the unsigned 16-bit planar image.

[`func floodFill(from: CGPoint, newColor: Pixel_ARGB_16U, connectivity: vImage.FloodFillConnectivity)`](/documentation/Accelerate/vImage/PixelBuffer/floodFill(from:newColor:connectivity:)-6hsrg)

Applies an in-place flood-fill operation to the interleaved 4-channel, unsigned16-bit-per-pixel image.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)