Jump to content

RGB color channel value lost when Alpha value is 0


Recommended Posts

Depending on what you're using your image for, there can actually be a difference between transparent white and transparent black.

For any alpha value of 1 or greater my color value is maintained. But when that alpha value goes to 0 Paint.NET always represents that as transparent black.

This is totally driving me nuts and is going to force me to use some other tool to fix up my alpha channels after the fact. Say it ain't so :'(

Link to comment
Share on other sites

There have been other threads on this subject. The bottom line is that yes it matters what you are using the image for, but Paint.NET has no way of knowing that in advance. The layer composition code errs on the side of mathematical correctness*, in which case there is no such thing as "transparent black". It's just transparent. All transparent colors are equivalent, and the math involved actually results in undefined RGB values** which we just clamp to be zero.

At this point you don't actually have an alpha channel, you have a "scratch" channel. Paint.NET does not know anything about "scratch" channels. The alpha channel is treated as an honest and mathematically consistent alpha channel, not as some channel whose value is circumstantial.

* In other words, we don't err.

** Division by zero is technically positive or negative infinity. I guess you could propose that the average of -infinity and +infinity is zero, and thus there is no actual clamping going on. But we do not yet have a "quantum theory of pixels" ... :?

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Why not just use a really, really low alpha value?

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

True. But it would be visually indistinguishable.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...