Selective Color

Moderator: jsachs

Post Reply
Robert Schleif
Posts: 340
Joined: May 1st, 2009, 8:28 pm

Selective Color

Post by Robert Schleif »

Being confined at home, there is little to shoot except flowers. I am having a problem removing out of focus flowers in the background. It appears that pixels in the transition zone between blurred flower and background greenery possess various colors that are the combination of flower color and background color. Selective color doesn't recognize these, and I'm rarely successful in trying to have selective color modify each of the multiple colors in the transition zone. Likely due to the wide range of colors in the transition region I've also been unsuccessful trying to use color curves or conditional curve.

In PWP 8 is there a way to address this problem?

So far, the only new capability in PWP 8 that I can think of for solving the problem would be to decompose small areas into pixels that are purely one color (the flower color) and nearby pixels such that their overall sum is the color of that small region (sort of like half tones). Then, when selective color operates, it would change the flower and the flower-colored pixels in the transition zone, and presto, the flower has vanished into the background.

The transition zone effect is also a problem in some landscapes where the transition zone is nearly white and then looks like over sharpening.
jsachs
Posts: 4212
Joined: January 22nd, 2009, 11:03 pm

Re: Selective Color

Post by jsachs »

What you touch on is generally a very difficult problem since hardly any edges are truly sharp so the pixels on the boundary are a mixture of the colors on either side of the edge. This comes up for example if you try to darken a sky while lightening the foliage across a complex tree line as the boundary between sky and foliage starts to stand out as a white or black line.

On the other hand, if you are talking about removing something from the image you need to replace it with something else -- I typically do this by cloning some other part of the background, but depending on the situation this can be tricky. I'm not sure I see why you would be using Selective Color to remove a blurry flower. Maybe if you post an example you will get some good suggestions.

Especially with flower photos, it pays to be very careful when you take the picture what is behind the flower that makes up the main subject, since a busy background will usually be distracting. From a very low angle, sometimes you can get the sky as a background, or sometimes you can get some very dark foliage in the background. Commonly, professional flower photographers bring them into the studio and photograph them against a backdrop.
Jonathan Sachs
Digital Light & Color
Robert Schleif
Posts: 340
Joined: May 1st, 2009, 8:28 pm

Re: Selective Color

Post by Robert Schleif »

The border of the bottom half of the red flower behind the butterfly's right wing (somewhat accentuated by the size reduction and conversion to jpg) illustrates the problem.
Attachments
Example.jpg
Example.jpg (235.06 KiB) Viewed 2532 times
jsachs
Posts: 4212
Joined: January 22nd, 2009, 11:03 pm

Re: Selective Color

Post by jsachs »

I tried a few things and ultimately settled on this approach:

1) Create a mask that covers the blurred background flower using a series of flood fill operations and painting a soft edge around it.

2) Composite a shifted version of the image with itself to cover the masked region with other parts of the background.

3) Blur a somewhat larger region to smooth over the transition between the the old and new background.

Far from perfect, but maybe a good starting point and a few ideas you could use.
Flower.jpg
Flower.jpg (215.9 KiB) Viewed 2526 times
I had to zip the workspace script to get it to attach.

Before running the script, copy the original image to the clipboard. The script pastes it from the clipboard and takes it from there.
Attachments
Workspace.zip
(10.9 KiB) Downloaded 146 times
Jonathan Sachs
Digital Light & Color
Robert Schleif
Posts: 340
Joined: May 1st, 2009, 8:28 pm

Re: Selective Color

Post by Robert Schleif »

Thank you. Looks pretty good.
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Selective Color

Post by den »

Starting with the original image version... basically did as JS suggests to make the background more uniform, then:
1) used the Filter transform to basically vignette the background and add color/contrast to the butterfly/flower
2) created an Orton version of the resulting 1) image version with a preference HighKey brightening curve
3) Blended 38% of the Orton version with the resulting 1) image version
All along using 1:1 Cloning from various image versions to preference blend/touch up/blur...
Example v2.jpg
Example v2.jpg (215.23 KiB) Viewed 2507 times
.
...den...
Attachments
Example v1.zip
(11.11 KiB) Downloaded 138 times
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Selective Color

Post by tomczak »

I just started playing with Robert's image, and I was thinking about how to automate the separation of the background blurry flower from everything else by combining colour and texture attributes.

While Jonathan's and Den's multiple flooding seems to have solved the problem, I figured that maybe I could do this: use either Mask Color Range, or Mask Hue and Saturation or Mask Separate Based on Two Colours, which will also select similarly coloured parts of the foreground flower, and then subtract from it a second mask based on Mask Texture, which with the right settings could select only high-frequency foreground flower (which in turn, should leave only blurry, smooth background flower to be dealt with).

In theory that may work, I think, and I started experimenting.

What I don't quite understand is the Save Current Mask/Combine Saved Mask sequence. As I take it, it only works within a single mask session? So for example, the 4 separate masks in Mask Transformation are not connected to each other in that respect?

Then, when experimenting with Mask operations, I have a Mask Transformation which two masks, but when I Reopen Mask Dialog-box for either of them, it gives me a warning/error message 'no saved mask image'. I'm not sure what I've done, but I suspect that I tried Combine Saved Mask without having saved one first at one point, and the mask remembers this.
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4212
Joined: January 22nd, 2009, 11:03 pm

Re: Selective Color

Post by jsachs »

Here is an example of what Save/Combine is intended to be used for.

Say you draw and area with the freehand tool and then blur it. Next you want to draw another area with the freehand tool and blur that, possibly by a different amount, and then you want to combine the two blurred regions. So, here is what you do:

1) draw and blur the first region
2) save it
3) set the entire mask to black
4) draw and blur the second region
5) combine the saved mask (this uses the current mask mode (add/subtract/...), so it should be set to add

Think of it like temporary storage in a calculator used to evaluate complex expressions.

In testing this, I did discover a problem with the saved mask not re-appearing after saving the transformation and then re-opening it. Fixed for next release.
Jonathan Sachs
Digital Light & Color
Post Reply