About Channels

Shake can support and track different numbers of channels in an image dynamically in your composition, giving you channel independence as well as bit depth and resolution independence:

Therefore, the maximum amount of channels (for now) in a image is five, RGBAZ. Unfortunately, the Z code will not yet show up in the Viewer.

Shake will not limit you in combining different channel images, i.e, you can place a 2-channel image Over a 4-channel image. Shake is also optimized to work on a per-channel basis, so usually a 1-channel image will calculate about three times faster than a 3-channel image. For this reason, if you are reading in masks from a different package, feel free to make them 1-channel images to save on both disk-space and processing time. If you apply an operation that changes channel information, Shake will automatically update that information for you. For example, if you place a Monochrome or an Emboss on an RGB image, that image will become a BW image at that point, making following nodes faster. If you then place it Over an RGB image or change its color (i.e., Mult with values of 1.01,1,1), it will become an RGB image again.

In certain situations, this behavior may seem a bit non-intuitive. A 3-channel image placed Inside a matte image will still result in a 3-channel image – no matte channel is added to the result. This eliminates the need to add an alpha channel to the 3-channel image just to combine it. If, however, you do desire at some point to add or remove channels, you may use Copy, SwitchMatte, Set or Reorder.



How to view the number of channels in an image

You can tell what channels are in an image by:

How to change the number of channels in an image

As stated above, certain operations will automatically add or remove channels when using them, for example Emboss and Monochrome will change an RGB to a BW, and a non-uniform Add will change a BW to RGB. You can also explicitly change the number of channels in an image with specific functions: 
Function Changes... Operation
SwitchMatte adds A Copies in any channel from the second input to be used as the new alpha channel for the first input
Copy adds R,G,B,A, or Z Will copy a channel from the second input to the same position in the first input, i.e., if you are copying Z, then the second image must have the Z channel.
Reorder adds or removes R,G,B,A, or Z By using n or 0, you remove that channel:

rgbn or rgb0 remove the Alpha channel

rgbal adds the luminance into the Z channel.

000a or nnna turns the image into a 1-channel Alpha image.

Set adds or removes R,G,B,A, or Z By setting a value to 0, it removes that channel. By setting a channel to something other than 0, you add that channel

 

Many operations allow you to select which channel you want to modify something. For example, the per-node masking, SwitchMatte, KeyMix, IBlur, etc, all give you the option to select the R,G,B, or A channel as you control or alpha channel. This will often remove the need to swap your channels around before you do many operations. Two exceptions to this are Layer- Inside and Outside, which always depend on the second image's alpha channel.

To turn a BW (or BWA) image into an RGB (or RGBA) without changing its values, use two Color - Reorders using rgab (create one node, then just copy it)