I have a PNG image that has many shades of gray and no transparency:

enter image description here

I would like to turn the grayscale into an alpha channel in Paint.net, so that the parts that are completely white would become completely transparent, the parts that are completely black stay the same and the gray parts become transparent black, so that the lighter they are the more transparent they become, for example it would turn RGBA(100,100,100,255) into RGBA(0,0,0,155).

I found this question about Photoshop, I would like to do the same thing but in Paint.net.

Is there a way to do this in Paint.net?


I was unable to create the desired effect with blending, but there is a plug-in that offers this functionality: Alpha Mask. (I have no association with the author.) Download the ZIP file and extract the DLL to this folder:

C:\Program Files\paint.net\Effects

That adds an Alpha Mask... entry to the Effects menu. Using that menu item produces an Alpha Mask Settings dialog. To make the black parts of the mask produce full opacity, check Invert Mask. If the target image (that will be masked) isn't fully opaque everywhere, you might want to check Mix Alpha. You can use a mask image on your clipboard or load it from a file.

settings dialog

Using your mask on my avatar, I get this image:

example masked image

(The result I got was actually transparent where appropriate, but that may have been lost in the upload.)


You could also use Alpha Space.

Starting from either white or black pixels, it makes them transparent the closer they are to the starting color. So for example, with your image, with this setting you keep the black with no transparency and the outer grays with a varying alpha level.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.