<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImage/PixelBuffer/flatten(channelOrdering:backgroundColor:isPremultiplied:destination:)-97nx",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO11PixelBufferVAaC14Interleaved8x4VRszrlE7flatten15channelOrdering15backgroundColor15isPremultiplied11destinationyAC07ChannelH0O_s5UInt8V_A3PtSbAEy_AC14Interleaved8x3VGtF"
  },
  "title" : "flatten(channelOrdering:backgroundColor:isPremultiplied:destination:)"
}
-->

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

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_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.

---

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)