Swizzle Alpha into RGB seems broken?

Hi,

I noticed unusual behavior with swizzling the alpha component into any RGB channel. In the first image, I have constructed an image where the R component has the same values as the alpha component, and the r channel is displayed. In the second image, I’ve swizzled from A to R. Notice to dramatic increase in values after the swizzle. This behavior is consistent with at least PNG and TGA so I expect it not to be format dependent.

Conversely, but not demonstrated here. Swizzling any channel from RGB to A seems to have the opposite effect, where the value ranges decrease.

I can’t think of why this behavior should be happening. So I thought I’d report it for a sanity check.


Hi @jesse.r.meyer!

This is because the effects stack’s input and output use linear-space colors. When the alpha channel’s swizzled into the red channel, it’ll be displayed as if it was a linear color channel (i.e. the colors you’ll see are passed through a linear-to-sRGB transform).

You can make the swizzle filter operate on sRGB colors by adding a Linear to sRGB filter before it and adding an sRGB to Linear filter after it, like this:

image

Hope this helps!

Thanks for explaining. I figured it was yet another implicit sRGB conversion taking place!