Sign in to follow this  
Tanel

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

Recommended Posts

Tanel    7

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! 8)

Share this post


Link to post
Share on other sites
Tanel    7

quick note: I fixed a little UI appearance problem (related to win xp theme) about 10 minutes ago,

you may want to re-download (clean your browser cache before that).

Share this post


Link to post
Share on other sites
Ash    9

Can you put it in either

Effects->Adjustment ?

or

Effects->Colors ?

or If you can think of a better place?

Thanks.

Share this post


Link to post
Share on other sites
Tanel    7
Can you put it in either

Effects->Adjustment ?

or

Effects->Colors ?

or If you can think of a better place?

Thanks.

I couldn't make my mind on that, so I left it in Effects menu. Maybe I have better idea after some more user comments... :roll:

Share this post


Link to post
Share on other sites

really nice

just a thing what about an UI like the Conditional Hue\Saturation?

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

oh yeah and Adjustments menu too, if you don't mind...

Thanks :D:D

Share this post


Link to post
Share on other sites
Effects->Colors ?

or If you can think of a better place?

Thanks.

Wouldn't it be "Color" (without "s")?

(I just want to avoid to have two submenus with the same meaning.)

I don't care where this fine plugin is located, but I don't think it's an adjustment.

Share this post


Link to post
Share on other sites
Geoff    0

Tanel, nice update and great improvements from "Tone Picker", glad to see you took my advice and added the "feather" effect to your plug-in :D .

Geoff

Share this post


Link to post
Share on other sites
Tanel    7
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.

Share this post


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

Share this post


Link to post
Share on other sites
Ash    9

Please keep the UI as it is, it's very easy to work with and different then Con/Hue/Sat.

Share this post


Link to post
Share on other sites
barkbark00    3
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. ;)

Share this post


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

Share this post


Link to post
Share on other sites
Deborah    0

The downside of the Conditional Hue/Sat UI is that you can't select shades (black/white/gray). For that reason I prefer the current UI. Great plugin.

Share this post


Link to post
Share on other sites
Tanel    7

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

Share this post


Link to post
Share on other sites
bEPIK    1

I like the colour wheel but agree with Deborah, so why not mix them?

ColourtoAlpha2.png

(I have no coding experience so I don't know if it's possible or difficult to make this UI)

Pros - Smaller window (71% of original size), has colour wheel, can still choose brightness, can still fine tune

Cons - Takes time to make

Thanks for the plugin :)

Share this post


Link to post
Share on other sites
BoltBait    1,226

I would rather see the From and To values on the screen at the same time. That way my brain can comprehend the range that I'm working with.

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