---
title: "vImageFlatten_BGRAFFFFToRGBFFF(_:_:_:_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vimageflatten_bgrafffftorgbfff(_:_:_:_:_:)"
---

# vImageFlatten_BGRAFFFFToRGBFFF(_:_:_:_:_:)

Flattens a 32-bit-per-channel BGRA buffer against a solid background to produce a 32-bit-per-channel RGB result.

## Declaration

```swift
func vImageFlatten_BGRAFFFFToRGBFFF(_: UnsafePointer<vImage_Buffer>, _: UnsafePointer<vImage_Buffer>, _: UnsafePointer<Float>, _: Bool, _: vImage_Flags) -> vImage_Error
```

## Return Value

Return Value kvImageNoError; otherwise, one of the error codes in Data Types and Constants.

## Discussion

Discussion Parameters The function uses the following calculation to flatten the source image:  if( isImagePremultiplied )      color = color + (1.0f - alpha) * backgroundColor  else      color = color * alpha + (1.0f - alpha) * backgroundColor

## See Also

### Flattening 4-channel, 32-bit images to three channels

- [vImageFlatten_ARGBFFFFToRGBFFF(_:_:_:_:_:)](accelerate/vimageflatten_argbfffftorgbfff(_:_:_:_:_:).md)
- [vImageFlatten_RGBAFFFFToRGBFFF(_:_:_:_:_:)](accelerate/vimageflatten_rgbafffftorgbfff(_:_:_:_:_:).md)
