BoltBait's Pages - Transparency

Sarcasm, just one of the services I offer.


Paint.NET Transparency Adjustment Effect

I noticed that when I changed a layer's opacity and merged another layer onto it, the result was less than I expected.  The transparency never came out as you saw it on the screen. This turned out to be a problem when I was making collages of pictures and I was attempting to put drop shadows around some of the pictures.  When I merged the picture layer with its drop shadow layer, it didn't look good at all.

Since there is no way in Paint.NET to directly adjust the alpha of a selection independent of the entire layer, I decided to write an effect to do it.


The Idea

I figured that I could write an Adjustment effect that would manipulate the Alpha bits of the current layer directly instead of during the layer blend process.  This turned out to be more difficult than I expected because adjusting the alpha didn't look natural in my first try.  I wanted to mimic the way it looked when the layer opacity was being adjusted.  Then, I had to decide what to do with totally transparent pixels.  You can't just turn up the opacity of them because, technically, they don't have a color defined.  I decided not to decide.   I'll let the user decide what to do with them--either ignore them or fill them with the secondary color before adjustment.

I also figured this would be a good project to learn how to make custom interfaces to effects.  Until this point I have had other people write the user interfaces for my effects.

The effect works pretty well and I'm getting some good use out of it.


The Effect DLL

You can download the precompiled effect DLL here: Transparency.dll

Just drop this file in your \program files\Paint.NET\effects directory and you should be all set.


Instructions for Use


In order to use this effect, first select the pixels that you want to adjust.  If you do not make a selection, the current layer will be affected.

Then, click the Adjustments menu and select Transparency.

Move the slider to the left to make your selection more transparent or move your slider to the right to make your selection less transparent.

If you would like to adjust transparent pixels, be sure to uncheck the  "Ignore trasparent pixels" check box.  Completely transparent pixels will be filled with the secondary color before being adjusted.

When your selection looks the way you want, click OK.  Otherwise, click Cancel to undo your changes.



I hope you find this effect useful.

Sunday, January 28, 2007