MJW

Color Clearer

14 posts in this topic

what is the difference between color clearer and reverse blend set to average color; i've tried and got the same things with the picture of spider.

on the other hand on the bomber i've applied manual color correction and then magic wand with first tolerance to 0 to get fine outline and 16 to achieve a good result;

better than with anything else. the two pictures got non uniform blue color backgrounds.

post-79095-0-85338600-1465289281_thumb.j

post-79095-0-03482500-1465289301_thumb.p

post-79095-0-23372000-1465289421_thumb.p

0

Share this post


Link to post
Share on other sites

Hi MJW!

 

I've tried your new plugin with the example pic I used on 'Make Transparent' plugin the other day.  Here are the results:

 

th_Make%20Transparent%20Original_zpsi4hv     th_Make%20Transparent%20Example_zpslxsgb      th_Color%20Clearer%20Example_zpstdwmgmyd

           Original                              Make Transparent                       Color Clearer

 

 

I notice that your plugin seems to be more precise. It left some of a really dark shade of orange (more red I believe) behind. Is this correct?   Thanks!     :)

Edited by lynxster4
1

Share this post


Link to post
Share on other sites

homebrew: Obviously Color Clearer is much simpler than Reverse Blend. It was intended to resemble Make Transparent. Besides simplicity -- which is an advantage if that's exactly what you want to do -- the main advantage over Reverse Blend is that Color Clearer handles partial transparency correctly. Color Clearer is also slightly more accurate than Reverse Blend. I endeavored to make it exactly match the original image when blended to a background of the selected color. So far, it looks like I succeeded, but there are lots of combinations of color and transparency, and I certainly haven't tested them all.

 

I'll mention that handling partial transparency turns out to be remarkably easy. I thought it would be something like multiplying the computed alpha by the image pixel alpha. Instead, it's simply a matter of computing the new alpha and color relative to the image color alpha-blended with the selected color. That's the color that has to be matched.

 

lynxster4: I'd always assumed Make Transparent reduced the alpha and modified the color so that the image didn't change when blended to the selected color. I intended to modify it to handle transparency. I discovered, though, that when the image color is light gray, and the selected color is dark gray, blending to the dark gray does not produce the original color. (I believe Make Transparent only works the way I'd expected when all the color components are 0 or 255.) It may be a bug, or it may be that Make Transparent simply wasn't intended to do what I expected it to do. In any case, because it required a completely different algorithm and produced substantially different results, I decided to write my own plugin instead of modifying Make Transparent.

 

So in summary, if you want to remove the background color in a way that it will match the original image when blended with the background color, Make Transparent won't do it while Color Clearer will. (Reverse Blend will also work, provided the image doesn't have partially transparent pixels.)

0

Share this post


Link to post
Share on other sites

lynxster4:

It left some of a really dark shade of orange (more red I believe) behind. Is this correct?


Of course there's always the possibility of a bug, but I doubt that's the case here. Reverse Blend behaves the same way. The reason is probably that the orange contains a lot of green, while the red color contains very little. In order to blend to the original color, the alpha must be fairly large, since a small value results in too much green being blended in. One of the color components of the modified color is always either 0 or 255. Otherwise, alpha could be decreased. In this case green is 0, making the color redder than originally.

0

Share this post


Link to post
Share on other sites

I just realized there's an oddity, which isn't exactly a bug, but nevertheless bugs me. When calculating the new color values, there is often a range of values for each of the RGB components that will result in the same color, especially for small alphas. Currently, I rather arbitrarily use the highest value. The result of this is that if for one of the RGB color components, the selected color value is the same as the color value being matched, the computed value might be another, different value. That doesn't seem to make much sense, so I think I'll fix it. I'm not sure of the best way, though. The easy way is to test to see if the color values match, and if so, skip the normal computation and use that value. I may, though, want to change the computation to use the middle of the range, or something like that, in a way that gives the input values when they match. I'll need to think about it.

0

Share this post


Link to post
Share on other sites

I've been able to modify “dull” white clouds and blue skies into something more interesting by combining Hot Metal Glow with Color Clearer —at least within the scope of what I consider an interesting sky. Here's an example in which I use Color Clearer to remove the red “bloody” areas created by Hot Metal Glow while preserving the rest intact:

 

Color_Clearer_test_collage.jpg

 

The Hot Metal Glow settings I apply to a duplicate of the sky layer are: Celsius Temperature = 0, Orange Desaturation = 1, Invert Color Range = True, and everything else at defaults.

Next, I apply Color Clearer to this hot-metal-glowed layer while keeping the original sky layer below it, in two steps, first selecting #C00000 as the color to make transparent, and subsequently choosing pure red as the color to make transparent.

Finally, I add a black and white gradient layer set to overlay above both sky layers (this is to fade some of the clouds and to add a more vivid light to the finished sky).

 

Everything was tested on a 100% PdN sky layer, but I guess it may work well on a photo of a real sky (check pending).

 

I've also tried to mimic the color clearing steps with the Make Transparent plugin, but it threw me an error at times and the aspect was not quite similar whenever I got it to work. Besides, I noticed that using the plugin for a second time on an already red-free sky layer caused the transparent areas to become filled with black, whereas the remaining areas turned into jagged yellowish stains.

 

Thanks a lot one more time, MJW! You always come up with the right effect I need for special compositions. I'm super glad you're this good at implementing such nifty algorithms hi.gif

 

Color Clearer 1.1 for PdN 3.5.11.zip

Edited by Maximilian
2

Share this post


Link to post
Share on other sites

Thank you for the 3.5.11 build, Maximilian. I feel a little guilty, but I'm going to have an updated version of Color Clearer soon. I figured out a reasonably good solution to the problem I mentioned in my previous comment. It took me a while to figure out the math.

1

Share this post


Link to post
Share on other sites

No problem. As soon as you share the updated code, I can try to update my compilation as well. I hope the new code will compile correctly for me. Otherwise, I'll have to start asking questions if I run into difficulties :)

0

Share this post


Link to post
Share on other sites

There should be no problem compiling it. There's nothing fancy about the changes.

0

Share this post


Link to post
Share on other sites

I posted a new version which I believe makes a better choice for the adjusted color. I also added an additional control that allows a choice for transparent pixels between the original color or transparent white.

1

Share this post


Link to post
Share on other sites

I've also recompiled and updated my post above with version 1.1 for PdN 3.5.11

Thanks once again, MJW! hi.gif

0

Share this post


Link to post
Share on other sites

MJW!

 

Thank you very much for the plugin.  :pizza:  :beer:

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