canvaskit-wasm 0.39
build 2026-04-29
AlphaType
How the alpha channel of a pixel buffer relates to its color channels. Carried on ImageInfo and consumed by MakeImage, readPixels, etc.
All values
| Value | Storage |
|---|---|
Premul | RGB is already multiplied by alpha. (0.5, 0, 0, 0.5) means 50% red at 50% alpha. Skia's preferred internal format. |
Unpremul | RGB independent of alpha. (1, 0, 0, 0.5) means full red at 50% alpha. What CSS / SVG / browser color-pickers use. |
Opaque | Alpha is implicitly 1. Saves a channel; the alpha bytes (if present) are ignored. |
See also
ImageInfo,ColorType.Surface.makeImageFromTextureSource—srcIsPremulargument.