Storage options for alpha component data.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
typedef enum CGImageAlphaInfo : uint32_t {
...
} CGImageAlphaInfo;
Overview
A CGImage
constant specifies (1) whether a bitmap contains an alpha channel, (2) where the alpha bits are located in the image data, and (3) whether the alpha value is premultiplied. You can obtain a CGImage
constant for an image by calling the CGImage
function. (You provide a CGBitmap
constant to the function CGImage
, part of which is a CGImage
constant.)
Alpha blending is accomplished by combining the color components of the source image with the color components of the destination image using the linear interpolation formula, where “source” is one color component of one pixel of the new paint and “destination” is one color component of the background image.
Core Graphics supports premultiplied alpha only for images. You should not premultiply any other color values specified in Core Graphics.