Is this an Alpha Bug in Blender Comp?

I am trying to merge a RGB color node with a float node which will be the alpha, although it’s not really alpha but I am using it in my game engine to represent data for the shadows. I do not want the alpha channel to affect the RGB channels in any way, and it seems like a bug to me that it would, except when visualizing with the RGBA enabled of course.

However, that is not the case in my test scene. When I visualize RGB only, I can see a halo outline of where the edge of the shadow is in white, this is also what I get when I output my image. If you know how to solve this, I’d love to know as I am trying to submit this for a deadline.

Again, what I expect when merging an alpha channel with an RGB image is that the RGB data channels do not change. What you see here is if you visualize the RGB output and uncheck “use alpha” the RGB image changes.

I tried messing with linear color space inputs instead of sRGB, which does actually look more like what I was getting in photoshop, and the unwanted halo is smaller, but still there.

Link to download the blend file with packed images:

That’s a problem that is really hard to solve because some developers seem not to get it.
I keep fighting with this for quite a while now and don’t succeed.
Some time ago I wrote a little article about it, keep linking to it wherever I can, but unfortunately it seems that I am the only one who is against the weird preview that we have now.
If you have some time, please try to go through this. It won’t change anything I’m afraid, but at least will give you the idea of the issues we are facing:

You’ll notice the date: November 2013. This shows for how long I’ve been fighting.

I didn’t read every word of your document, but it does look like it might be related. You are right in that I want to see the actual RGB data which is stored without any modification when viewed in RGB mode. However the issue for me is less with the viewer and more the data that I am actually getting out. What I am getting out in my RGB is exactly what I am getting in the viewer RGB which is not at all what I have stored in my RGB channels.

I just tried an experiment last night where in my own C++ code I created an RGBA image with the data I want specifically stored in RGB along with an alpha containing the completely separate data I want. I loaded that file back into Blender and plugged it directly into a viewer node and I get the same broken result.

It’s as if Blender is pre-multiplying, then dividing by alpha to set it back to straight rather than just keeping it straight. And since divide by 0 doesn’t work, it just sets it to white so I see my natural RGB only in the completely black areas or the completely white areas.

For what I am trying to do, any pre-multiplying would be bad. Ideally any node which does a pre-multiply should have a checkbox to disable pre-multiply.

It seems like it only has the correct result if alpha is 0 or 1, but anything in-between is just wrong.

Here’s what an example alpha looks like:

If I disable alpha in the viewer node (and therefore blow away my alpha channel) the RGB data looks correct. Which means the problem is in the viewer node and possibly that the image out node is doing the same thing (pre-mult then divide for no apparent reason).