Channel Shuffle

Builds a texture by picking each of its channels from a channel of an input, or setting it to 0 or 1.

Outputs

NameTypeDescription
OutputTextureThe assembled texture.

Inputs

NameTypeDescription
InputslistTextureThe textures the channels are taken from, each stretched over the whole output. Connecting to the list adds an input at the end.

Parameters

NameTypeDescription
ModeEnumWhether every channel comes from the first input, or each channel says which input it comes from.Choices: Single Input, Multiple Inputs
Red SourceEnumWhich of the connected inputs the red channel is taken from. Only present in Multiple Inputs mode.
Red ChannelEnumWhich channel of that input becomes red, or a fixed 0 or 1.Choices: Red, Green, Blue, Alpha, 0, 1
Green SourceEnumWhich of the connected inputs the green channel is taken from. Only present in Multiple Inputs mode.
Green ChannelEnumWhich channel of that input becomes green, or a fixed 0 or 1.Choices: Red, Green, Blue, Alpha, 0, 1
Blue SourceEnumWhich of the connected inputs the blue channel is taken from. Only present in Multiple Inputs mode.
Blue ChannelEnumWhich channel of that input becomes blue, or a fixed 0 or 1.Choices: Red, Green, Blue, Alpha, 0, 1
Alpha SourceEnumWhich of the connected inputs the alpha channel is taken from. Only present in Multiple Inputs mode.
Alpha ChannelEnumWhich channel of that input becomes alpha, or a fixed 0 or 1.Choices: Red, Green, Blue, Alpha, 0, 1
SizeEnumWhere the size of the output comes from. Largest and Smallest take it from the inputs, Custom from Resolution. Only present in Multiple Inputs mode.Choices: Largest, Smallest, Custom
ResolutionVector 2 IntThe width and height of the output in pixels. Only present when Size is Custom.
FilteradvancedEnumHow an input of another size is read between its pixels. Nearest keeps hard pixels, and both Linear choices blend them.Choices: Nearest, Linear Fast, Linear Nice
FormatadvancedEnumThe pixel format of the output. Auto has the fewest channels that hold the result, at the precision of the inputs.

The Channel Shuffle operator builds a texture channel by channel, taking each channel from a channel of an input or setting it to 0 or 1. Use it to swap red and blue, to make a texture opaque, or to put the gray of one texture into the alpha of another.

In Single Input mode, every channel comes from the first input, and the output has its size. In Multiple Inputs mode, each channel also picks the input it comes from.

A gray texture reads the same in red, green and blue, and its alpha reads 1. Removing an input moves the ones after it up by one, and a channel that pointed at the removed one reads 0 until it is set again.

See also Grayscale, Blend.

Keywords: swizzle, channels, rgba, combine, split, alpha, pack, mask, reorder, swap