Jump to content
How to Install Plugins ×

UnAlpha (Remove or Replace Alpha Pixels)

Recommended Posts

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



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

"....brings out the duty in my soul" -Spinal Tap

Link to comment
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



Link to comment
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.



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

"....brings out the duty in my soul" -Spinal Tap

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 8 years later...

I have a picture of an object in front of a white background and I want to reduce the alpha of the background color to be able to put it in front of a differently-colored background.
Apparently I'm doing something wrong here because exactly nothing changes, no matter where I put the sliders... Shouldn't the following settings yield a result?

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.

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...