---
title: MPSAlphaType
framework: metalperformanceshaders
role: symbol
role_heading: Enumeration
path: metalperformanceshaders/mpsalphatype
---

# MPSAlphaType

Premultiplication description for the color channels of an image.

## Declaration

```swift
enum MPSAlphaType
```

## Overview

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:  |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |  Most 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 kernels and they insert extra operations to ensure a correct conversion. Fully opaque images should use MPSAlphaTypeAlphaIsOne

## Topics

### Constants

- [MPSAlphaType.nonPremultiplied](metalperformanceshaders/mpsalphatype/nonpremultiplied.md)
- [MPSAlphaType.alphaIsOne](metalperformanceshaders/mpsalphatype/alphaisone.md)
- [MPSAlphaType.premultiplied](metalperformanceshaders/mpsalphatype/premultiplied.md)

### Initializers

- [init(rawValue:)](metalperformanceshaders/mpsalphatype/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Methods

- [init(device:srcAlpha:destAlpha:backgroundColor:conversionInfo:)](metalperformanceshaders/mpsimageconversion/init(device:srcalpha:destalpha:backgroundcolor:conversioninfo:).md)
