<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSAlphaType",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:@E@MPSAlphaType"
  },
  "title" : "MPSAlphaType"
}
-->

# MPSAlphaType

Premultiplication description for the color channels of an image.

```
enum MPSAlphaType
```

## Overview

Some image data is premultiplied. That is to say that the color channels are stored instead as `color*alpha`. This is an optimization for image compositing (alpha blending), but it can get in the way of most other image filters, especially those that apply non-linear effects like the color conversion filters and functions like convolution or resampling filters that look at adjacent pixels, where the alpha may not be the same. The following are some basic conversion cases:

|Source            |Destination       |Operation                              |
|------------------|------------------|---------------------------------------|
|`NonPremultiplied`|`NonPremultiplied`|None.                                  |
|`NonPremultiplied`|`AlphaIsOne`      |Composite with opaque background color.|
|`NonPremultiplied`|`Premultiplied`   |Multiply color channels by alpha.      |
|`AlphaIsOne`      |`NonPremultiplied`|Set alpha to 1.                        |
|`AlphaIsOne`      |`AlphaIsOne`      |Set alpha to 1.                        |
|`AlphaIsOne`      |`Premultiplied`   |Set alpha to 1.                        |
|`Premultiplied`   |`NonPremultiplied`|Divide color channels by alpha.        |
|`Premultiplied`   |`AlphaIsOne`      |Composite with opaque background color.|
|`Premultiplied`   |`Premultiplied`   |None.                                  |

Most [`MPSKernel`](/documentation/MetalPerformanceShaders/MPSKernel) objects require non-premultiplied or completely opaque colors to work correctly. They implictly assume that alpha is equal to 1 and do not provide functions for the user to specify alpha channel types. Currently, the only filters that can handle premultiplied data are the color conversion filters provided by [`MPSImageConversion`](/documentation/MetalPerformanceShaders/MPSImageConversion) kernels and they insert extra operations to ensure a correct conversion. Fully opaque images should use `MPSAlphaTypeAlphaIsOne`

## Topics

### Constants

[`MPSAlphaType.nonPremultiplied`](/documentation/MetalPerformanceShaders/MPSAlphaType/nonPremultiplied)

The image is not premultiplied by alpha.

[`MPSAlphaType.alphaIsOne`](/documentation/MetalPerformanceShaders/MPSAlphaType/alphaIsOne)

Alpha is guaranteed to be 1.

[`MPSAlphaType.premultiplied`](/documentation/MetalPerformanceShaders/MPSAlphaType/premultiplied)

The image is premultiplied by alpha.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)