---
title: "vImageConvert_RGB888toBGRA8888(_:_:_:_:_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/vimageconvert_rgb888tobgra8888(_:_:_:_:_:_:)"
---

# vImageConvert_RGB888toBGRA8888(_:_:_:_:_:_:)

Combines an 8-bit-per-channel, 3-channel RGB buffer and either an 8-bit alpha buffer or constant alpha value to produce a BGRA result.

## Declaration

```swift
func vImageConvert_RGB888toBGRA8888(_: UnsafePointer<vImage_Buffer>, _: UnsafePointer<vImage_Buffer>!, _: Pixel_8, _: UnsafePointer<vImage_Buffer>, _: Bool, _: vImage_Flags) -> vImage_Error
```

## Return Value

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

## Discussion

Discussion Parameters If you specify premultiply as true, the function uses the following calculation to perform the conversion:  r = (a * r + 127) / 255  g = (a * g + 127) / 255  b = (a * b + 127) / 255

## See Also

### Conversion from 8-bit-per-channel, 3-channel interleaved buffers

- [vImageConvert_RGB888toARGB8888(_:_:_:_:_:_:)](accelerate/vimageconvert_rgb888toargb8888(_:_:_:_:_:_:).md)
- [vImageConvert_RGB888toRGBA8888(_:_:_:_:_:_:)](accelerate/vimageconvert_rgb888torgba8888(_:_:_:_:_:_:).md)
