Jump to content

Color to Alpha v2.2 (2008-12-24)


Recommended Posts

This plugin extracts a color range from image, by leaving pixels of selected color opaque and making the rest transparent. Only alpha values are altered, color remains intact.

It is useful if you need to edit certain colors on your image separately: duplicate the image layer and run the plugin to get color-based "selection" for further editing.

It is more flexible than Magic Wand or Curves+ which could provide similar results but not always exactly as needed.

 

Menu location: Effects > Photo.

Download as part of my plugin pack.

colortoalpha_ss2.png

 

Updated to version 2.2 (2008-12-24)!

Changes: few UI and code optimizations; moved to Color submenu.

 

Updated to version 2.1 (2008-08-31)!

- Compatibility fix for paint.net 3.36

 

Changes in v2 (2008-01-23):

- Effect is now located in Adjustments menu

- Added check box "Override Original Alpha" (see details below)

- Few minor bugfixes

 

Use the six color controls (on top) to define your color selection,

and three adjustment controls (on bottom) to adjust the output.

For ease of use, the default color range is defined around primary color. So I suggest to use color picker tool before starting the plugin.

 

Check box near each color control defines whether you restrict color by this parameter or not. Unchecking equals to selecting the full range.

Tolerance control makes alpha to fade off gradually, based on color's similarity to selected color. Max tolerance makes full alpha gradient from selected color to it's opposite (for example from full bright to full dark, if brightness from 255 to 255 is selected).

Feather control softens edges by blurring alpha channel by selected radius. I recommended to adjust this after all other controls are set, due to heavy impact on processing speed.

Base Opacity control adjusts alpha of "non-selected" color.

Invert Alpha check box inverts final alpha.

Override Original Alpha check box controls how to handle originally transparent/semitransparent pixels:

- unchecked (default) -> transparent pixels remain transparent, even if pixel's color match your selected color

- checked -> transparent pixels turn opaque if pixel's color match your selected color

Reset button returns to default setting (that is: color range from primary color and other controls zero).

 

Note: greyscale pixels are also treated as color, defined by Hue=0, Saturation=0.

 

Example:

here I attempted to extract skin tones from the photo. I started with color picker tool and clicked in the middle of his raised arm to get a good color sample. Then opened the plugin, adjusted the color range a bit, finally feathered by amount of 4. Screenshot:

colortoalpha_s1.jpg

 

You can learn the behaviour of this plugin on my test image, containing hue, saturation and brightness gradients:

link.

 

Tip: Feather, Base Opacity and Invert Alpha can be also used independently from color controls (with unchecked Hue/Sat/Brigh); so you may find alternative uses:

- Feather

- Base Opacity: to "un-erase" erased areas

- Invert Alpha: to invert opacity

 

Enjoy!

 

Edited by toe_head2001
Restored images
Link to post
Share on other sites

This is really stinkin' cool, Tanel. :-)

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to post
Share on other sites
just a thing what about an UI like the Conditional Hue\Saturation?

you know with the color wheel to show the range..

I'm a fan of that color wheel - angle control too, but this is Evan's own creation and I don't want to rip off his code.
oh yeah and Adjustments menu too, if you don't mind...
I tend to agree on Adjustments menu, seems to be more relevant than Effects. I will change it together with other possible fixes in a week or so.
Link to post
Share on other sites
I'm a fan of that color wheel - angle control too, but this is Evan's own creation and I don't want to rip off his code.

isn't that what open source is? something you can use to your own work by 'inspiration' from the work of others, without abusing it of course...

Link to post
Share on other sites
Please keep the UI as it is, it's very easy to work with and different then Con/Hue/Sat.
Personally, I disagree. At first use, trying to figure how to select your desired color range takes way too long. I think Conditional Hue/Sat makes the whole color range selection thing way more discoverable.

Once you get past that, this plugin is one of the best plugins ever...just to be clear. ;)

 

Take responsibility for your own intelligence. ;) -Rick Brewster

Link to post
Share on other sites
Please keep the UI as it is, it's very easy to work with and different then Con/Hue/Sat.
Personally, I disagree. At first use, trying to figure how to select your desired color range takes way too long. I think Conditional Hue/Sat makes the whole color range selection thing way more discoverable.

Once you get past that, this plugin is one of the best plugins ever...just to be clear. ;)

I concur. I like Conditional Hue/Sat's UI...like barkbark00 mentioned, good stuff. That being said, it's your plugin and you are free to do whatever you like with it. Beggars can't be choosers...we're just lucky to have it! :D

Link to post
Share on other sites

Hi,

I have made few improvements, please upgrade!

Download link in 1st post.

Changes in v2:

1) Effect is now located in Adjustments menu.

2) Fixed a bug caused by PDN's Gaussian Blur misbehaviour. Semitransparent areas are now feathered correctly.

3) Added check box "Override Original Alpha". This controls how to handle originally transparent/semitransparent pixels:

- unchecked (default) -> transparent pixels remain transparent, even if pixel's color match your selected color.

- checked -> transparent pixels turn opaque if pixel's color match your selected color.

This is useful if a layer contains erased areas: you can decide wheter to keep those intact or not.

BTW, note that Feather, Base Opacity and Invert Alpha can be also used independently from color controls (with unchecked Hue/Sat/Brigh); so you may find alternative uses:

- Feather (without mishandling semitransparent areas -> bug in current Feather and Gaussian Blur Channel effects)

- Base Opacity to "un-erase" erased areas

- Invert Alpha to invert opacity

Link to post
Share on other sites
  • 3 months later...

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