Jump to content
How to Install Plugins ×

Invert Alpha


Recommended Posts

Invert Alpha

A Simple Plugin to Invert the Alpha Channel

  Download

 

Invert Alpha is a simple plugin that inverts your Alpha Channel based off of your set tolerance. This plugin is most useful when dealing with transparency gradients, creating alpha masks, and more. To use this plugin, simply extract the zip file to your Effects folder and restart Paint.NET. Then go to Adjustments-> Invert Alpha. Toying with the tolerance is recommended to discover some more interesting uses for this plugin.

invertalpha.png

 

Edited by toe_head2001
Reattached Zip
signature.png

Link to comment
Share on other sites

Don't know right I'm or not, but this is new Utility.ClampToByte() code:

#region UICode
int Amount1 = 0; // [0,255] Transparensy
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{
   PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);
   ColorBgra CurrentPixel;
   int R, G, B;
   byte A;
   for(int y = rect.Top; y < rect.Bottom; y++)
   {
       for (int x = rect.Left; x < rect.Right; x++)
       {
               CurrentPixel = src[x,y];
               R = (int)CurrentPixel.R;
               G = (int)CurrentPixel.G;
               B = (int)CurrentPixel.B;
               A = (byte)(int)(Amount1 - CurrentPixel.A);
               dst[x,y] = ColorBgra.FromBgra(Utility.ClampToByte(,Utility.ClampToByte(G),Utility.ClampToByte(R),Utility.ClampToByte(A));
       }
   }
}

Link to comment
Share on other sites

Alright, Alpha Works is finished but not compiled yet. I need Code Lab to start behaving correctly and I will make the big upload.

CodeLab is fine. It's your script... Don't use anything but alphanumeric characters in the .cs file name of your effect. CodeLab uses that filename as your namespace... "namespaces" must be alphanumeric without spaces. I have added a note about this to CodeLab's help file.

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.

×
×
  • Create New...