Jump to content


Photo

Invert Alpha


  • Please log in to reply
20 replies to this topic

#1 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 29 April 2008 - 01:06 AM

Invert Alpha
A Simple Plugin to Invert the Alpha Channel

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.

Posted Image
Attached File  InvertAlpha.zip   3.91K   2419 downloads


Posted Image


#2 pyrochild

pyrochild

    Plugin Author of the Year 2012

  • Administrators
  • 11,245 posts
  • LocationColorado
  • Reputation:131

Posted 29 April 2008 - 01:09 AM

Your first real plugin! Hurrah!
I expect Liquefy next :P

Posted Image
[I write plugins and stuff] [Follow my stupid brain on Twitter]

If you like a post, upvote it!


#3 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 29 April 2008 - 01:09 AM

Dont hold your breath to long :D

Also, I want to give my thanks to Pyrochild for helping me out with this basic plugin.

Posted Image


#4 pyrochild

pyrochild

    Plugin Author of the Year 2012

  • Administrators
  • 11,245 posts
  • LocationColorado
  • Reputation:131

Posted 29 April 2008 - 01:10 AM

Also, I want to give my thanks to Pyrochild for helping me out with this basic plugin.

Don't say that - people will think it's another prank!

Posted Image
[I write plugins and stuff] [Follow my stupid brain on Twitter]

If you like a post, upvote it!


#5 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 29 April 2008 - 01:12 AM

Lol, then I also want to say this is NOT a prank.

Also, thanks to BoltBait for publishing Code Lab and making my first plugin possible :wink:

Posted Image


#6 Simon Brown

Simon Brown
  • Members
  • 10,185 posts
  • Reputation:15

Posted 29 April 2008 - 03:02 PM

Lol, then I also want to say this is NOT a prank.


Thus giving the further impression that it is, in fact, a prank.
Posted Image

#7 IceFusion

IceFusion
  • Members
  • 394 posts
  • LocationSouth Africa
  • Reputation:0

Posted 29 April 2008 - 03:21 PM

Good plugin, mostly I just use a transparent gradient, I don't really change it around, but congrats on the plugin.

Posted Image
:) Visit-> My Website <-Visit :)
Please Call Me Elite Override

The trick to flying is throwing yourself at the floor and missing.


#8 Simon Brown

Simon Brown
  • Members
  • 10,185 posts
  • Reputation:15

Posted 29 April 2008 - 03:28 PM

I look forward to seeing your plugins in future. :)
Posted Image

#9 R3VENGE

R3VENGE
  • Members
  • 1,162 posts
  • Reputation:0

Posted 30 April 2008 - 04:11 PM

nice plugin :D i look forward to seeing more of your works :D

Posted Image
psn id: R3V-fiR3


#10 Truelove

Truelove
  • Newbies
  • 4 posts
  • LocationMinsk, BY
  • Reputation:0

Posted 04 May 2008 - 07:49 PM

Very useful with HDR lighting...

This is CodeLab code:

Enjoy!

#11 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 04 May 2008 - 07:52 PM

TrueLove, while it is a basic plugin I would prefer that the source to any or all of my plugins be distributed solely by me. But I am glad that you enjoy using this plugin, and I hope it is a good start for future plugins from me.

Posted Image


#12 Truelove

Truelove
  • Newbies
  • 4 posts
  • LocationMinsk, BY
  • Reputation:0

Posted 04 May 2008 - 09:51 PM

Sorry if something going wrong, I've just wrote this source by myself to recreate your work. That's will not happen again.

#13 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 04 May 2008 - 10:13 PM

Not a real problem at all. And you wrote it exactly as i wrote it, that is why I got confused.

Posted Image


#14 BoltBait

BoltBait
  • Administrators
  • 8,910 posts
  • LocationCalifornia, USA
  • Reputation:103

Posted 04 May 2008 - 10:34 PM

If that's true, you have a bug in your code. You should use Utility.ClampToByte in there somewhere... :D
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#15 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 05 May 2008 - 01:45 AM

...?

What bug? Who is buggin around?

Anyways, this plugin is going to be superseded soon with some extra features. It will be entitled 'Alpha Works' and I wish I could confirm some extra features. Until then, good night to you all!

Posted Image


#16 Truelove

Truelove
  • Newbies
  • 4 posts
  • LocationMinsk, BY
  • Reputation:0

Posted 06 May 2008 - 02:35 PM

I imagine broken brain, when will try to rewrite new "Alpha Works" code... :D

#17 Truelove

Truelove
  • Newbies
  • 4 posts
  • LocationMinsk, BY
  • Reputation:0

Posted 06 May 2008 - 02:41 PM

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(B),Utility.ClampToByte(G),Utility.ClampToByte®,Utility.ClampToByte(A));
        }
    }
}


#18 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 06 May 2008 - 05:59 PM

I will begin working on Alpha Works as soon as I get some more testing in with IndirectUI.

Posted Image


#19 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 09 May 2008 - 11:19 PM

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

Posted Image


#20 BoltBait

BoltBait
  • Administrators
  • 8,910 posts
  • LocationCalifornia, USA
  • Reputation:103

Posted 10 May 2008 - 09:04 PM

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.
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game