Bands, alpha, and transparency
An alpha channel is an extra band that describes coverage, but a four-band image does not automatically prove that the fourth band is alpha. You also need the image interpretation, format, and metadata.
The checkerboard only visualizes transparency and is not part of the image pixels.
What the value means
Section titled “What the value means”In a typical 8-bit RGBA image, alpha 0 is fully transparent and 255 is fully opaque. Floating-point images and other bit depths can use different ranges, so a general pipeline should not hard-code 0..255.
A transparent pixel still carries colour values. An invisible pixel can be “transparent black” or “transparent white,” and those hidden values can affect edges during resize, blur, or compositing.
Premultiplication
Section titled “Premultiplication”Premultiplied alpha scales colour bands by alpha first. Some convolution and interpolation operations behave more reliably in this representation, but the image usually needs to be returned to the representation expected by the output saver.
A robust sequence is often:
- Confirm that the image really has alpha.
- Premultiply before operations that need it.
- Resize, blur, or composite.
- Unpremultiply.
- Preserve alpha or flatten onto a background according to the output format.
This page’s govips example calls Resize. In the pinned v2.19.0 source, that method runs PremultiplyAlpha before resizing and UnpremultiplyAlpha afterwards. This is verified, version-specific binding behavior—not a default guarantee for every operation or binding.