---
title: "unpremultiply(channelOrdering:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/unpremultiply(channelordering:)-82uq3"
---

# unpremultiply(channelOrdering:)

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

## Declaration

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

## Parameters

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

## Discussion

Discussion This function divides 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 divides 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.unpremultiply(channelOrdering: .ARGB)

// Prints "[0.5, 0.25, 0.5, 1.0]" print(src.array)

## See Also

### Unpremultiply

- [unpremultiply(alpha:)](accelerate/vimage/pixelbuffer/unpremultiply(alpha:)-xnog.md)
- [unpremultiply(alpha:)](accelerate/vimage/pixelbuffer/unpremultiply(alpha:)-i0ri.md)
- [unpremultiply(channelOrdering:)](accelerate/vimage/pixelbuffer/unpremultiply(channelordering:)-1pkat.md)
- [unpremultiply(channelOrdering:)](accelerate/vimage/pixelbuffer/unpremultiply(channelordering:)-19l0s.md)
- [unpremultiply()](accelerate/vimage/pixelbuffer/unpremultiply().md)
