#1685·PixiEditor

[BUG]: Separate Channels/Combine Channels nodes are almost too complicated to be useful (big writeup)

Author: EqubuxuCreated Aug 15, 2026Updated Aug 15, 2026
Labelsbug

Bug Description

This was prompted by

  • #1683

as well as the few times people on discord asked us about using this node (and us not even being able to explain properly).

Image

Any reasonable person looking at the Separate Channels node would expect it to output Red, Green, Blue and Alpha channels separately. Someone more observant might notice that the output is also a painter, so they might then think that even though the Red output has 4 channels, it would just output the same value 4 times. The actual logic is so complicated that it's impossible to guess without reading the source code, and even after writing it down, it's still too hard to keep the entire mental picture of how it works in my head, like I'd actually need to spend time memorizing the code it to use the node propertly. Here is the actual logic:

Grayscale checkbox unchecked

With the Grayscale checkbox unchecked, the output of the node is like this:

Red output: Image with RGBA: (red channel from input, 0, 0, 1)
Green output: Image with RGBA: (0, green channel from input, 0, 1)
Blue output: Image with RGBA: (0, 0, blue channel from input, 1)
Alpha output: Image with RGBA: (0, 0, 0, alpha channel from input)

This seems logical initially, if not for the main usecase of this node being shuffling (swizzling) the channels around (putting red in place of blue, etc). Since the values stay confined to their channels, you won't get any results by plugging say Green into the Red input of Combine Channels.

The usecase I can see for this is when you want to take red from image1, green from image2, and put them in the corresponding channels in image3 (no shuffling). I believe this is the only usecase where the nodes would behave according to the expectation of the user.

Grayscale checkbox checked

With the Grayscale checkbox checked, the output of the node becomes:

Red output: Image with RGBA: (red channel from input, red channel from input, red channel from input, 1)
Green output: Image with RGBA: (green channel from input, green channel from input, green channel from input, 1)
Blue output: Image with RGBA: (blue channel from input, blue channel from input, blue channel from input, 1)
Alpha output: Image with RGBA: (alpha channel from input, alpha channel from input, alpha channel from input, 1)

One positive first: this does finally let you shuffle (swizzling) the channels around. But with an exception: in the Combine Channels node you still cannot apply Red, Green, or Blue to Alpha (see how in the lists above, the alpha output is always 1, except for the one time it's taken from the input). Also, even if it does help with shuffling (swizzling) channels, how is the user supposed to guess that from the name "Checkbox"? Let alone understand that alpha behaves in a special way.

I should say that I fully understand that this functionality came from the limitations that

  • Outputs must be painters
  • Alpha premultiplication must be considered But it seems to me that these limitations are just too much, where you basically cannot implement a good pair of Combine/Separate image nodes with them.

With all that, I believe that in their current form, Combine and Separate channels nodes don't provide any good functionality. The Matrix transform filter can already do everything these nodes can. These nodes only take what Matrix Transform does and add confusion on top of it.

My proposed solution: Introduce a new "virtual" Channel type

First of all, this solution is not compatible with the node in the current form, so some sort of a migration procedure would be needed.

The idea is to make a "new" type for the node graph, which will actually just be Painter concealed as a different type. The new type will conceptually represent a grayscale image that only has one channel. That would make the node pair looks something like this:

Image

The bright green represents the Channel type.

Conceptually, Separate Channels will now output 4 images that each only has one channel taken from the input image. The Grayscale checkbox will be removed. Combine Channels will then take 4 separate channels and combine them. Once again, conceptually, this would work exactly like the Combine/Separate Color nodes.

Internally, the Channel type will just be a painter, that by convention will be expected to paint an image that has Alpha = 1, and Red, Green, and Blue channels to be all equal. In other words this will be just a way to store a single-channel image in a normal painter. With that, the Combine Channels node will be able to simply take the red channel and transfer it to the right channel in its output. Its grayscale checkbox also won't be necessary.

I think this new type shouldn't be implicitly convertible FROM painter, as it will lead to slightly strange behavior when plugging normal painters into Combine channels. However, converting implicitly TO painter doesn't seem like a problem, the output will be a simple grayscale image, which is what the Channel type is supposed to represent in the first place.

P.S.: I also had a second solution that involved nuking these nodes entirely and replacing them with Extract one channel node (same as current Separate Channels with Grayscale is enabled and only one output + channel dropdown) and a new version of Combine channels node that lets you specify explicitly which input channels to take the red, green, and blue from, but after writing the above this second idea just seems worse and more complicated.

Steps how to trigger the issue

bash
-

How did you download the software?

Built from source

Version Channel

Development

Version Number

2.1.2.1

Operating System

Windows

OS Version

Win 11

Additional Context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct