Jump to content

Paint.NET alpha behaving badly?

Recommended Posts

When I save out a 32-bit TGA from Paint.NET, the alpha channel appears to be stamped into the RGB channels as well. You can see this in Photoshop when you load the file back in: if you look at the RGB channels only they have been made black where the alpha was zero.

Although for most purposes I'm sure this is fine, it's a MASSIVE ball-ache for the project I'm working on, for a number of reasons. For one thing, I can't just turn off alpha blending and re-use the texture as a solid fill in my renderer, and there are other workflow related problems it causes.

The only reason I can think of for doing this is to improve RLE compression. If you could possibly, possibly find the time to make it optional in a forthcoming release... :)

Link to comment
Share on other sites

  • 1 month later...

Only the PDN format stores the color of completely transparent pixels. All other formats set transparent pixels to black, not just TGA and regardless of RLE compression.

Perhaps you could try giving stuff an alpha value of 1 instead 0 so that the color is preserved. Though I can't imagine what your work could be to require this.

Link to comment
Share on other sites

No this is done because #00000000 is equivalent to all other colors with zero alpha. They are transparent. A transparent color value is a transparent color value. #00000000 is not transparent black. It is transparent.

There are a few other threads on here where I go into detail on this, so I won't repeat much of it. The mathematics dictate it -- when alpha is zero, the color values are lost, and there's no mathematical way to preserve them*. You should not ever rely on the RGB values when alpha is zero. This has nothing to do with RLE compression.

* Either that or it would halve performance of the whole system. I forget. It doesn't matter.

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

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


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.

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...