sam_

Deleting selection leaving behind transparent white instead of black

Recommended Posts

Today while working on an image I encountered a strange issue that I have never encountered before midway through editing. Selecting an area and pressing delete typically leaves transparent black or RGBA(0,0,0,0), but now for some reason it is leaving transparent white RGBA(255,255,255,0). I have looked through the documentation to find if I pressed a hotkey by accident, and I have checked every setting to find what I may have changed but have come up with nothing.

 

I know for certain this is not normal behavior as I have layers in my image that have only had a selection deleted and the area is RGBA(0,0,0,0), while now replicating the exact same operation leaves RGBA(255,255,255,0).

 

Why is this an issue? I'm working on textures for 3D applications that use RGBA channels for texture data, and I'm now getting values of 255 instead of 0 as it has been for years. I know I can press backspace while having the current selected color as transparent black as a work around, but I'd prefer the previous behaviour.

Share this post


Link to post
Share on other sites

As far as I know, deleting an area has always left transparent white.

 

I have a plugin, Transparent to Transparent Black, that will convert all transparent pixels to transparent black. You can also notice that in a comment dated Sept. 27, 2017,  I say:

 

On 9/27/2017 at 7:03 PM, MJW said:

When you clear a selection with Erase Selection, PDN fills the region with pixels with 0 for alpha, and (255, 255, 255) for the RGB values.

Share this post


Link to post
Share on other sites

But I have layers in my image that I know for certain that I have only selected and deleted which have transparent black.

Share this post


Link to post
Share on other sites
5 minutes ago, MJW said:

As far as I know, deleting an area has always left transparent white.

 

You are correct.

 

3 minutes ago, sam_ said:

I know for certain that I have only selected and deleted which have transparent black.

 

You are mistaken.

Share this post


Link to post
Share on other sites

Mistaken how? I am looking at an image I have just been working on the past hour. There is a layer where I know for certain all I have done is erase a selection. The color picker returns transparent black. When I replicate that operation it now returns transparent white.

 

I have been using this program for many years making similar images that use RGBA channels for data and I have never had this issue, so it's not as simple as "I'm mistaken"

 

Here is the the layer I'm working with https://drive.google.com/file/d/1wpWcYjbCKQHorV3OhJ3FvQhOa3fUWf_G/view?usp=sharing 

The old layer is what I have just done an hour ago, the new layer I have just done now.

Share this post


Link to post
Share on other sites

We don't doubt the area is transparent black, but we have no way of confirming how it became transparent black, and wonder if you really know for certain that all you did in some past time was erase a selection.

Share this post


Link to post
Share on other sites

I really do know for certain, not only because I have just made this image but because I have made many images in the past where having transparent white would lead to massive artifacting in the textures I make for 3D applications.

 

The images I create are specular maps that use R for masking, G for specular value, B for metal and A for glossiness. If erasing a selection did always leave transparent white then I would have broken specular mapping in the 3D application as areas that should have no value in fact have a value of 255 in masking, specular value and metal, which produces a black shiny mess.

 

I have just tried to remake a specular map I have made a few days ago and have the same issue. The transparent areas in the original are black, but in the one I just remade they are transparent white.

 

This image I have linked in my last post is a texture that I made multiple layers of and cut up like so:

zV4uKs1.png

 

The only way I would have done this is to select the area and delete it. The transparent area is black, but if I replicate it now then it's white.

 

I feel like I'm losing my mind here. I have evidence in front of me that it used to return transparent black, but now it doesn't and everyone says it never did.

Edited by sam_

Share this post


Link to post
Share on other sites

If PDN ever leaves transparent black when erasing a selection, that would be the anomaly. I also do things that depend on the color of the transparent pixels, and in the many years I've been using PDN, I never seen it fill an erased selection with anything but transparent white. As the comment I quoted form 2017 shows, I not only noticed that sections were erased to transparent white, I remarked on that fact. I can't say that there are no circumstances that PDN would erase a selection to transparent black, but if they are, they would probably be unusual.

Share this post


Link to post
Share on other sites

Here's what will fill a transparent, erased selection with transparent black: erase a selection on a canvas then use the Invert Colors adjustment to invert the colors.  The transparent colors are also inverted. Perhaps you did something like that. Many of the adjustments -- including built-in adjustments -- modify transparent colors.

Share this post


Link to post
Share on other sites

I can also press backspace to fill instead of erase while having transparent black as the selected color. But, after creating thousands of specular maps over the years I have never actually done this, and I always hit delete and not backspace to erase and not fill. It's even muscle memory for me to press ctrl+A followed by delete when I'm about to paste a selection.

 

Could this be related to a plugin perhaps? More specifically is there a config file or some way that a plugin can determine what color is returned when a selection is erased? 

Share this post


Link to post
Share on other sites
7 minutes ago, sam_ said:

Could this be related to a plugin perhaps? More specifically is there a config file or some way that a plugin can determine what color is returned when a selection is erased? 

 

No, plugins can't effect anything like that. Plugins can modify the pixels in the active layer of the current image, and change what's in the clipboard (which is really separate from PDN), and that's about it.

Share this post


Link to post
Share on other sites

More likely you're just misremembering something. Or perhaps there' are some particular circumstances that result in selections being erased to transparent black. I tried a few things, like setting the Primary and Secondary colors to transparent black, and none of those changed the behavior of Erase Selection.

Share this post


Link to post
Share on other sites

I have been doing nothing since I made my post but trying to replicate what I may have done. I have a very regular process for making specular maps and just generally editing. And I can't produce a specular map the same as before without first recoloring each new layer to transparent black. There's nothing that I could have misremembered, I've done this enough times in the past. The only other thing I can think of is there is some change in the way paint.net loads .dds files. Which seems unlikely.

Share this post


Link to post
Share on other sites

If you save something as a file, the transparent color may change in the file. I don't know about .dds files, but I'm pretty sure transparent colors are all changed to transparent black in .png files.

Share this post


Link to post
Share on other sites
1 hour ago, sam_ said:

The only other thing I can think of is there is some change in the way paint.net loads .dds files. Which seems unlikely.

 

Actually, this could be VERY likely.

 

Let's ask the expert... @null54, has there been a change here?

Share this post


Link to post
Share on other sites
10 hours ago, BoltBait said:

has there been a change here?

 

Not as far as I am aware.

The OP mentioned that this occurs when creating a new layer, which would be a Paint.NET issue.

 

DDSFileTypePlus preserves the RGB color values of transparent pixels when saving, due to the fact that some games use the alpha channel for things other than transparency.

It would be easy to add a "Preserve color of transparent pixels" checkbox to allow this behavior to be disabled, transparent pixels would be set to black when it is unchecked.

Share this post


Link to post
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.