---
title: "alphaComposite(_:topLayer:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/alphacomposite(_:toplayer:destination:)-fybo"
---

# alphaComposite(_:topLayer:destination:)

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

## Declaration

```swift
func alphaComposite(_ compositeMode: vImage.CompositeMode<Pixel_8>, topLayer: vImage.PixelBuffer<Format>, destination: vImage.PixelBuffer<Format>)
```

## Parameters

- `compositeMode`: The composite mode.
- `topLayer`: The composite top layer.
- `destination`: The destination pixel buffer.

## Discussion

Discussion This function treats self as the bottom layer and both pixel buffers must have alpha as their first channel.

## See Also

### Related Documentation

- [Compositing images with alpha blending](accelerate/compositing-images-with-alpha-blending.md)

### Alpha compositing

- [alphaComposite(_:topLayer:destination:)](accelerate/vimage/pixelbuffer/alphacomposite(_:toplayer:destination:)-w1zc.md)
- [vImage.CompositeMode](accelerate/vimage/compositemode.md)
