Jump to content

Transparent pixels are always black


Recommended Posts

If I colour a pixel opaque white (i.e. alpha value of 255) and then test the colour of that pixel using the "Color Picker" (dropper) tool, it reports the colour as opaque white.

...so far, so good...

If I colour a pixel transparent white (i.e. white with an alpha value of 0) and then test the colour, it comes back as transparent black.

Transparent white and transparent black are not the same colour. They look the same on their own, but they will behave differently when interacting with neighbouring pixels, for instance if the image is resampled to a different resolution.

Am I missing a trick here? Am I confusing the action of the Color Picker with the actual color of the underlying pixel?

Link to comment
Share on other sites

I am able to recreate this on 2.61/2.62. (I went to test this and noticed I hadn't upgraded. Nice new 16px icon! Looks nice in my Quick-Launch tray. :wink:)

Start a new image and create a new layer. Set the Primary color to FFFFFF and slide the Alpha slider to 0. Use the Paint Bucket to fill the layer with the Primary color, then sample it with the Color Picker. The Colors box now reads 000000 with 0 Alpha.

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
Share on other sites

I see what you mean. That behavior is 100% correct.

You are blending a pixel that has 0 alpha on to another pixel that has 0 alpha. Since the pixel you are trying to blend has 0 alpha, it makes no contribution to the resultant pixel's color value, and is effectively a no-op.

If you turn off alpha blending, however, the pixels will then be set to exactly what you specify. The alpha blending setting is honored by the pixel tool.

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

That makes sense. I didn't even think about that. However, I don't mean to be a thorn in thy side, but regardless of the state of the Alpha Blending toggle, I can reproduce this. I set the color to white, the Alpha to 0, fill a new layer, sample it with the eyedropper, and the Primary color box changes from white fading down to transparent to black fading down to transparent.

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
Share on other sites

Hmm, you're right. That repros here as well, with the paint bucket tool. I'll file a bug. However, a color value with an alpha of 0 should be equivalent to all other 0-alpha color values.

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

Yeah, they should be the same. I've personally never experienced a problem with the "dirty transparency," but it's better to know when your program isn't doing what you told it to.

Time for some disciplinary action! Like a time-out in the corner, or something. >_>

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
Share on other sites

Thanks for the quick reponse guys! I'm glad you can reproduce the problem.

I agree that, on it's own, a pixel with 0 alpha is the same as any other 0 alpha pixel, regardless of its RGB components.

However, consider a 2 x 1 pixel image where the left pixel is opaque white and the right pixel is transparent white. If you resize this image to 1 x 1 pixels, the resulting pixel should be something like:

RGBA = 255, 255, 255, 128

Now, if the right hand pixel had been transparent black instead, the pixel colour after resize should be:

RGBA = 128, 128, 128, 128

These two are obviously visibily different.

This effect may also occur when combining layers, but only with positive values of alpha.

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.

 Share

×
×
  • Create New...