---
title: "unpremultiply(alpha:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/unpremultiply(alpha:)-xnog"
---

# unpremultiply(alpha:)

Transforms an 8-bit planar pixel buffer in-place from premultiplied alpha format to nonpremultiplied alpha format.

## Declaration

```swift
func unpremultiply(alpha: vImage.PixelBuffer<Format>)
```

## Parameters

- `alpha`: An 8-bit planar pixel buffer that contains the alpha.

## Discussion

Discussion This function divides the color values in self by the corresponding alpha values. The function treats the values 0 ... 255 in both pixel buffers as the values 0 ... 1. For example, the following code premultiplies a 4 x 1 planar pixel buffer with the corresponding pixels in a separate planar alpha buffer: let src = vImage.PixelBuffer<vImage.Planar8>(     pixelValues: [32, 64, 128, 255],     size: vImage.Size(width: 4, height: 1))

let alpha = vImage.PixelBuffer<vImage.Planar8>(     pixelValues: [0, 128, 128, 255],     size: vImage.Size(width: 4, height: 1))

src.unpremultiply(alpha: alpha)

// Prints "[0, 128, 255, 255]". print(src.array)

## See Also

### Unpremultiply

- [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)
- [unpremultiply(channelOrdering:)](accelerate/vimage/pixelbuffer/unpremultiply(channelordering:)-82uq3.md)
