returns the alpha channel of image.


  • AlphaChannel returns an image in which each pixel represents the opacity of the corresponding pixel. Alpha channels are typically used for highlighting regions of interest or masking the image.
  • If image has no alpha channel, the opacity of each pixel is assumed to be 1. »
  • AlphaChannel works with arbitrary 2D and 3D images.


open allclose all

Basic Examples  (2)

Alpha channel of an image:

Alpha channel of a 3D image:

Applications  (3)

Visualize an image background by negating its alpha channel:

Alpha channel is used for separating foreground from background:

Extract the alpha channel corresponding to the foreground:

Compute the area of the foreground:

Count number of foreground components using the alpha channel:

Count the number of connected components:

Properties & Relations  (2)

Verify if an image has an alpha channel:

The alpha channel of a completely opaque image is white:

Alpha channel is returned as a grayscale image:

Alpha channel has the same data type as the image:

Introduced in 2010
Updated in 2012