About Channels |
Shake supports and
tracks different numbers of channels in an image in your composition, giving
you channel independence as well as bit depth and resolution independence:
Code | Description |
BW (Black and White) | 1-Channel grayscale image |
A (Alpha) | 1-Channel matte image |
BWA | 2-Channel grayscale image with matte channel |
RGB | 3-Channel color image |
RGBA | 4-Channel color image with matte channel |
An additional Z channel can be added to any of the above.
Therefore, the maximum amount of channels in an image is five, RGBAZ. Unfortunately, the Z channel does not show up in the Viewer unless you use the Z ViewerScript, but it notifies you that there is a Z channel available on the top of the Viewer.In Shake, you can combine different channel images. For example, you can composite a 2-channel image over a 4-channel image. Shake is also optimized to work on a per-channel basis, a 1-channel image usually calculates about three times faster than a 3-channel image. For this reason, if you read in masks from a different package, feel free to make them 1-channel images to save on disk-space and processing time. If you apply an operation that changes channel information, Shake automatically updates that information for you. For example, if you place a Color - Monochrome or a Filter - Emboss node on an RGB image, that image becomes a BW image at that point, making following nodes faster. If you then composite it over an RGB image or change its color (Mult with values of 1.01,1,1), it becomes a RGB image again.
In certain situations, this behavior may seem a bit non-intuitive. A 3-channel
image composited with a Layer - Inside to a matte image still
results 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 want to add or remove channels at some point,
you can use Layer - Copy, Layer - SwitchMatte,
Color - Set or Color - Reorder.
As stated above, certain operations automatically add or remove channels, (for example Emboss and Monochrome change an RGB to a BW, and a non-uniform Add changes a BW to RGB). You can also explicitly change the number of channels in an image with specific functions.
The following functions also potentially modify image channels:
Function | Changes... | Operation |
Add | RGBAZ | A value raised above 0 creates that channel. |
Brightness | RGB | A brightness value set to 0 removes the RGB channels. |
Copy | adds R, G, B, A, or Z | Copies a channel from the second input to the same position in the first input. For example. if you copy Z, then the second image must have the Z channel. |
Emboss | Turns a RGB image to BW | This, of course, radically alters your image... |
Monochrome | Turns a RGB image to a BW | Uses a luminance balance, but you can adjust this to push specific channels. |
Mult | RGBAZ | Setting the RGBA or Z to 0 removes those channels. |
Reorder | adds or removes R,G,B,A, or Z | By using n or 0, you remove that channel:
rgbn or rgb0 removes the Alpha channel rgbal adds the luminance into the Z channel, thereby creating a Z channel. rrra creates a 2-channel image, assuming a is not black. 000a or nnna turns the image into a 1-channel Alpha image. |
Set | adds or removes R,G,B,A, or Z | A value set to 0 remove that channel. A channel set to something other than 0 adds that channel |
SwitchMatte | adds A | Copies in any channel from the second input to be used as the new Alpha channel for the first input. |
Many operations allow you to select which channel is used as a modifying channel. For example, SwitchMatte, KeyMix, IBlur, etc., all give you the option to select the R,G,B, or A channel as your control or Alpha channel. This often removes the need to swap your channels before you do many operations. Two exceptions to this are Layer- Inside and Layer- Outside, which always depend on the second image's Alpha channel.
To convert a BW (or BWA) image into an RGB (or RGBA) image without changing its values, specify this in the FileOut in the GUI. This isn't necessary in your node tree as Shake just figures it out. For batch operations, this can be somewhat annoying, so ForceRGB is included for the command line:
shake myBlackAndWhiteImage.iff -forcergb -fo myRGBImage