Hi Niall,
In PixInsight/PCL an alpha channel is, by definition, any channel in excess of the
nominal channels. Nominal channels are R, G and B for RGB color images, K (blacK) for grayscale images.
As seen by the PCL, an image is just a
vector of matrices, or a
data cube if you prefer a more geometrical interpretation instead of a purely structural view. Each channel is a matrix whose dimensions are the height (=matrix rows) and width (=matrix columns) of the image. Each channel (a.k.a.
plane) is a different matrix, so we actually have a stack of matrices, or a sliced cube.
A completely different thing is how these data structures are interpreted, and how are they related to specific properties of the image as a whole (separate data and functions, the object-oriented thing again

). For example, nominal channels are directly related to the color interpretation of pixel data, and as such they play an essential role in all functional blocks related to color spaces: from luminance/chrominance separations, to color management transformations, to screen renditions.
The first alpha channel, if it exists, defines the
opacity of each pixel. When alpha is 1, the pixel is opaque, and when alpha is zero, the pixel is completely transparent. Intermediate alpha values define partial transparency. Contrarily to what is customary in most imaging applications, opacity has nothing to do with masks in PixInsight. Again, I decided to keep both functional subsystems -masking and pixel opacity- separate and unrelated, for the sake of versatility and efficiency. As you know, a mask is any image selected as such in PixInsight. This means that masks are always external components of masked images, which is much better in terms of modularity (you can replace/modify an image's mask without changing the image) and reusability (a mask image doesn't know that it's being used as a mask).
The fact that the first alpha channel (which we call
active alpha channel) defines opacity is just a convention, observed to keep compatibility with other imaging applications. Pixel opacity is essential to embed images in other high-level objects, such as documents. For example, you can define an alpha channel to make the background of an image transparent when it is placed within a page in a page layout application (Scribus for example) or in a graphics editor (Inkscape for example).
The most important image formats fully supporting pixel opacity via alpha channels are TIFF and PNG. Notably, the JPEG format does not support alpha channels.