---
title: "flatten(channelOrdering:backgroundColor:isPremultiplied:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/flatten(channelordering:backgroundcolor:ispremultiplied:destination:)-97nx"
---

# flatten(channelOrdering:backgroundColor:isPremultiplied:destination:)

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

## Declaration

```swift
func flatten(channelOrdering: vImage.ChannelOrdering, backgroundColor: Pixel_8888, isPremultiplied: Bool, destination: vImage.PixelBuffer<vImage.Interleaved8x3>)
```

## Parameters

- `channelOrdering`: The channel ordering of the source buffer.
- `backgroundColor`: The background color that the function composites against.
- `isPremultiplied`: A Boolean values that specifies whether the source image is premultiplied.
- `destination`: The destination pixel buffer.

## See Also

### Flattening Channels

- [flatten(channelOrdering:backgroundColor:isPremultiplied:destination:)](accelerate/vimage/pixelbuffer/flatten(channelordering:backgroundcolor:ispremultiplied:destination:)-5g0c2.md)
- [vImage.ChannelOrdering](accelerate/vimage/channelordering.md)
