<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/blending-and-compositing-pixel-buffers",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Blending and compositing pixel buffers"
}
-->

# Blending and compositing pixel buffers

Composite two pixel buffers to create a single image.

## Topics

### Alpha compositing

[`func alphaComposite(vImage.CompositeMode<Pixel_8>, topLayer: vImage.PixelBuffer<Format>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/alphaComposite(_:topLayer:destination:)-fybo)

Performs alpha compositing of two 4-channel interleaved ARGB 8-bit pixel buffers using the specified composite mode.

[`func alphaComposite(vImage.CompositeMode<Pixel_F>, topLayer: vImage.PixelBuffer<Format>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/alphaComposite(_:topLayer:destination:)-w1zc)

Performs alpha compositing of two 4-channel interleaved ARGB 32-bit pixel buffers using the specified composite mode.

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

Constants that specify whether the format of layers is premultiplied or nonpremultiplied.

### Alpha blending

[`func premultipliedAlphaBlend(vImage.BlendMode, topLayer: vImage.PixelBuffer<Format>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/premultipliedAlphaBlend(_:topLayer:destination:))

Performs alpha compositing of two 4-channel interleaved RGBA 8-bit pixel buffers using the specified blend mode to produce a premultiplied result.

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

Constants that specify an alpha blending mode.

### Premultiply

[`func premultiply(alpha: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/premultiply(alpha:)-11gly)

Transforms an 8-bit planar pixel buffer in-place from nonpremultiplied alpha format to premultiplied alpha format.

[`func premultiply(alpha: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/premultiply(alpha:)-76rr)

Transforms a 32-bit planar pixel buffer in-place from nonpremultiplied alpha format to premultiplied alpha format.

[`func premultiply(channelOrdering: vImage.ChannelOrdering)`](/documentation/Accelerate/vImage/PixelBuffer/premultiply(channelOrdering:)-4xpq9)

Transforms an 8-bit ARGB or RGBA pixel buffer in-place from nonpremultiplied alpha format to premultiplied alpha format.

[`func premultiply(channelOrdering: vImage.ChannelOrdering)`](/documentation/Accelerate/vImage/PixelBuffer/premultiply(channelOrdering:)-302ci)

Transforms an unsigned 16-bit ARGB or RGBA pixel buffer in-place from nonpremultiplied alpha format to premultiplied alpha format.

[`func premultiply()`](/documentation/Accelerate/vImage/PixelBuffer/premultiply())

Transforms a floating-point 16-bit RGBA pixel buffer in-place from nonpremultiplied alpha format to premultiplied alpha format.

[`func premultiply(channelOrdering: vImage.ChannelOrdering)`](/documentation/Accelerate/vImage/PixelBuffer/premultiply(channelOrdering:)-fzwd)

Transforms a floating-point 32-bit ARGB or RGBA pixel buffer in-place from nonpremultiplied alpha format to premultiplied alpha format.

### Unpremultiply

[`func unpremultiply(alpha: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/unpremultiply(alpha:)-xnog)

Transforms an 8-bit planar pixel buffer in-place from premultiplied alpha format to nonpremultiplied alpha format.

[`func unpremultiply(alpha: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/unpremultiply(alpha:)-i0ri)

Transforms a 32-bit planar pixel buffer in-place from premultiplied alpha format to nonpremultiplied alpha format.

[`func unpremultiply(channelOrdering: vImage.ChannelOrdering)`](/documentation/Accelerate/vImage/PixelBuffer/unpremultiply(channelOrdering:)-1pkat)

Transforms an 8-bit ARGB or RGBA pixel buffer in-place from premultiplied alpha format to nonpremultiplied alpha format.

[`func unpremultiply(channelOrdering: vImage.ChannelOrdering)`](/documentation/Accelerate/vImage/PixelBuffer/unpremultiply(channelOrdering:)-19l0s)

Transforms an unsigned 16-bit ARGB or RGBA pixel buffer in-place from premultiplied alpha format to nonpremultiplied alpha format.

[`func unpremultiply()`](/documentation/Accelerate/vImage/PixelBuffer/unpremultiply())

Transforms a floating-point 16-bit RGBA pixel buffer in-place from premultiplied alpha format to nonpremultiplied alpha format.

[`func unpremultiply(channelOrdering: vImage.ChannelOrdering)`](/documentation/Accelerate/vImage/PixelBuffer/unpremultiply(channelOrdering:)-82uq3)

Transforms a 32-bit ARGB or RGBA pixel buffer in-place from premultiplied alpha format to nonpremultiplied alpha format.

### Linear interpolation

[`func linearInterpolate(bufferB: vImage.PixelBuffer<Format>, interpolationConstant: Float, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/linearInterpolate(bufferB:interpolationConstant:destination:))



---

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)