<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/applying-channel-operations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Applying channel operations"
}
-->

# Applying channel operations

Extract, flatten, permute, and overwrite the individual color channels of a pixel buffer.

## Topics

### Extracting Channels

[`func extractChannel(at: Int, destination: vImage.PixelBuffer<vImage.Planar8>)`](/documentation/Accelerate/vImage/PixelBuffer/extractChannel(at:destination:)-ageg)

Extracts a single channel from an 8-bit-per-channel, 4-channel interleaved pixel buffer.

[`func extractChannel(at: Int, destination: vImage.PixelBuffer<vImage.Planar16U>)`](/documentation/Accelerate/vImage/PixelBuffer/extractChannel(at:destination:)-i1zm)

Extracts a single channel from an unsigned 16-bit-per-channel, 4-channel interleaved pixel buffer.

[`func extractChannel(at: Int, destination: vImage.PixelBuffer<vImage.PlanarF>)`](/documentation/Accelerate/vImage/PixelBuffer/extractChannel(at:destination:)-8xrq1)

Extracts a single channel from an 32-bit-per-channel, 4-channel interleaved pixel buffer.

### Flattening Channels

[`func flatten(channelOrdering: vImage.ChannelOrdering, backgroundColor: Pixel_8888, isPremultiplied: Bool, destination: vImage.PixelBuffer<vImage.Interleaved8x3>)`](/documentation/Accelerate/vImage/PixelBuffer/flatten(channelOrdering:backgroundColor:isPremultiplied:destination:)-97nx)

Transforms an 8-bit-per-channel RGBA or ARGB buffer to an RGB buffer against an opaque background color.

[`func flatten(channelOrdering: vImage.ChannelOrdering, backgroundColor: Pixel_FFFF, isPremultiplied: Bool, destination: vImage.PixelBuffer<vImage.InterleavedFx3>)`](/documentation/Accelerate/vImage/PixelBuffer/flatten(channelOrdering:backgroundColor:isPremultiplied:destination:)-5g0c2)

Transforms an 32-bit-per-channel RGBA or ARGB buffer to an RGB buffer against an opaque background color.

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

Constants that specify the channel ordering of a pixel buffer.

### Permuting Channels

[`func permuteChannels(to: (UInt8, UInt8, UInt8), destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/permuteChannels(to:destination:)-4y4rh)

Permutes the channels of an 8-bit-per-channel, 3-channel interleaved pixel buffer.

[`func permuteChannels(to: (UInt8, UInt8, UInt8, UInt8), destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/permuteChannels(to:destination:)-tr2h)

Permutes the channels of an 8-bit-per-channel, 4-channel interleaved pixel buffer.

[`func permuteChannels(to: (UInt8, UInt8, UInt8, UInt8), destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/permuteChannels(to:destination:)-8y213)

Permutes the channels of an unsigned 16-bit-per-channel, 4-channel interleaved pixel buffer.

[`func permuteChannels(to: (UInt8, UInt8, UInt8, UInt8), destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/permuteChannels(to:destination:)-74dmh)

Permutes the channels of a floating-point 16-bit-per-channel, 4-channel interleaved pixel buffer.

[`func permuteChannels(to: (UInt8, UInt8, UInt8, UInt8), destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/permuteChannels(to:destination:)-6n6yi)

Permutes the channels of an 32-bit-per-channel, 4-channel interleaved pixel buffer.

### Overwriting Channels

[`func overwriteChannels(withScalar: Pixel_8)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(withScalar:)-3zb93)

Overwrites the pixels of the pixel buffer with the provided 8-bit scalar value.

[`func overwriteChannels(withScalar: Pixel_16F)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(withScalar:)-1hrrg)

Overwrites the pixels of the pixel buffer with the provided floating-point 16-bit scalar value.

[`func overwriteChannels(withScalar: Pixel_F)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(withScalar:)-1wm1o)

Overwrites the pixels of the pixel buffer with the provided 32-bit scalar value.

[`func overwriteChannels([UInt8], withScalar: Pixel_8, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withScalar:destination:)-57ov2)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 8-bit scalar value.

[`func overwriteChannels([UInt8], withScalar: Pixel_F, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withScalar:destination:)-ev8q)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 32-bit scalar value.

[`func overwriteChannels([UInt8], withPixel: Pixel_8888, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withPixel:destination:)-6fab6)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 8-bit, 4-channel pixel value.

[`func overwriteChannels([UInt8], withPixel: Pixel_ARGB_16U, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withPixel:destination:)-6zw3o)

Overwrites the pixels of one or more channels of the pixel buffer with the provided unsigned 16-bit, 4-channel pixel value.

[`func overwriteChannels([UInt8], withPixel: Pixel_FFFF, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withPixel:destination:)-6pbz8)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 32-bit, 4-channel pixel value.

[`func overwriteChannels([UInt8], withPlanarBuffer: vImage.PixelBuffer<vImage.Planar8>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withPlanarBuffer:destination:)-9jbky)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 8-bit planar pixel buffer.

[`func overwriteChannels([UInt8], withPlanarBuffer: vImage.PixelBuffer<vImage.PlanarF>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withPlanarBuffer:destination:)-hiw0)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 32-bit planar pixel buffer.

[`func overwriteChannels([UInt8], withInterleavedBuffer: vImage.PixelBuffer<Format>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withInterleavedBuffer:destination:)-74hah)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 8-bit interleaved pixel buffer.

[`func overwriteChannels([UInt8], withInterleavedBuffer: vImage.PixelBuffer<Format>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/overwriteChannels(_:withInterleavedBuffer:destination:)-8xkd1)

Overwrites the pixels of one or more channels of the pixel buffer with the provided 32-bit interleaved pixel buffer.



---

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)