---
title: "premultiply(channelOrdering:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/premultiply(channelordering:)-fzwd"
---

# premultiply(channelOrdering:)

Transforms a floating-point 32-bit ARGB or RGBA pixel buffer in-place from nonpremultiplied alpha format to premultiplied alpha format.

## Declaration

```swift
func premultiply(channelOrdering: vImage.ChannelOrdering)
```

## Parameters

- `channelOrdering`: The channel ordering of the source buffer.

## Discussion

Discussion This function multiplies the color values in each pixel self by the corresponding alpha value and copies the alpha value to the destination unchanged. For example, the following code multiplies the RGB values [0.125, 0.25, 0.5] by the alpha value 0.5: let src = vImage.PixelBuffer<vImage.InterleavedFx4>(     pixelValues: [0.5,                   0.125, 0.25, 0.5],     size: vImage.Size(width: 1, height: 1))

src.premultiply(channelOrdering: .ARGB)

// Prints "[0.5, 0.0625, 0.125, 0.25" print(src.array)

## See Also

### Premultiply

- [premultiply(alpha:)](accelerate/vimage/pixelbuffer/premultiply(alpha:)-11gly.md)
- [premultiply(alpha:)](accelerate/vimage/pixelbuffer/premultiply(alpha:)-76rr.md)
- [premultiply(channelOrdering:)](accelerate/vimage/pixelbuffer/premultiply(channelordering:)-4xpq9.md)
- [premultiply(channelOrdering:)](accelerate/vimage/pixelbuffer/premultiply(channelordering:)-302ci.md)
- [premultiply()](accelerate/vimage/pixelbuffer/premultiply().md)
