Sign in to follow this  
Followers 0
doverdemon77

UnAlpha (Remove or Replace Alpha Pixels)

4 posts in this topic

Need this one for a project I'm working on (modding a video game).

 

Anywayz, you can highlight Alpha Pixels (using whatever color you have set to the Primary Color in Paintnet's color wheel. But then you can REPLACE Alpha Pixels with a new Alpha Value set by you (via the plugin). Also, you don't HAVE to replace ALL the alphas as the plugin allows for upper and lower cutoff values.

 

For instance, I had this inventory box with Alpha-ized edges around the box that I wanted to keep that way. Inside the inventory box were all these pixels with around 204 alpha. I set the low alpha cutoff to 200, the high to 254, and the deed was dun. Sure, I could have SELECTED just those inside pixels but the corners are ROUNDED and you know how that lasso thing works so well...just makin' it easier on meself, that's all.................

 

Source Code Included

UnAlpha-03.zip

 

NOTE: 02 version uploaded. No changes except changed some code to make it less wastefull. Still does the crazy "working" bar in Paint.net when you're just moving the sliders to configure, but technically this one should be using less power as it does not select all the pixels until you use one of the checkbox options. Best I can do without figuring out what a void render is....

 

NOTE: 03 version uploaded. Had another use in my SHOWW2 mod, I had this transparent "light type/highlight effect" image that shows where to put a weapon in an inventory that was totally too weak (alpha values weren't high enough) for a black background. So, I added an add to and subtract from alpha values to the plugin. Read below for more info...Also deleted some stupid variables that the plugin wasn't using (using old plugins and I'm gettin' stupider by the day...hooray!)

Edited by doverdemon77
0

Share this post


Link to post
Share on other sites

Thanks for sharing this doverdemon77!

 

I managed to figure out how this works by experimentation.  As it's not exactly straightforward, how about a mini-tutorial to show users how to...,

 

1. Highlight

 

2. Replace

 

?

0

Share this post


Link to post
Share on other sites

Sure, to highlight, select a Primary Color in Paint.net's color wheel window. This will be the highlight color.

Overdrive Version = All pixels with Alpha UNDER the slider value are highlighted. EX: Slider = 100, pixels with an alpha value of 0 to 100 are highlighted.

Reg Version = Only Alpha pixels of the slider's value will be highlighted. EX: Silder = 40, pixels with Alpha of 40 are highlighted.

 

NOTE: You can use Reg Version to reset the Overdrive Version back to normal.

 

To Change the Alpha Value (UnAlpha):

01. UnAlpha Low Cutoff = All Alpha Values Below this sliders value will be ignored.

02. UnAlpha High Cutoff = All Alpha Values Above this slider's value will be ignored.

03. Alpha Replacement Level = Replace all pixels with an Alpha value between Low and High with an Alpha Value of this number.

 

EX:

Low = 200

High = 250

Replacement = 255

...All Pixels (selected) with an alpha value of 200 to 250 are replaced with the same RGB, but with an Alpha Value of 255.

 

For Version 03:

To Add to Alpha Value (UnAlpha)

01. Make sure Replacement is at 0

02. Whateva the adder slider is, it will look at each pixel's alpha value and then ADD the slider's amount to it. If the new Alpha Value is over 255, then it will just be 255.

For example:

Low = 0

High = 50

Add = 50

All pixels selected with an alpha value of 0 to 50 are replaced with same RGB, but an Alpha Value of +50. So, if the pixel's Alpha value was 25, it would now be 75.

 

To Subtract...same as add but it subtracts. Anything less than 0 will be 0.

 

*Also, you can use the Reg Version Highlighter to reset the plugin, kinda of a pain, but sometimes works.

Edited by doverdemon77
0

Share this post


Link to post
Share on other sites

Many thanks for that explanation. It will help users a lot when trying to figure out the plugin.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0