Subtractive filter and hue shifts

Moderator: jsachs

Post Reply
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Subtractive filter and hue shifts

Post by couman »

I frequently use the subtractive filter transformation with a mask to selectively recover detail in shadowed areas, and I became curious about the potential for color (hue) shifts. I set up a spreadsheet to calculate transformed values of H, S, and V given a set of these parameters for the original image. Working with color patches created and transformed in PWP, I checked my calculated values against those measured with PWP. Agreement was within the expected round off error. For the limited set of starting cases (3-dozen) that I tried, changes in H were generally less than 1 percent, but a couple of cases yielded changes of 2-3 percent.

Has anyone tried a more comprehensive examination of this problem? Or, can you suggest a particular area(s) of the color wheel where more significant changes in hue might be expected?
Bob Coutant
den
Posts: 859
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: Subtractive filter and hue shifts

Post by den »

BobC...

I believe the Filter transform in either Additive or Subtractive modes functions in the RGB color space... if this is the case, then hue and saturation shifts can be experienced as well as those for tone...

One way to avoid this possibility is to extract the image's H, S, and V channels... perform the Subtractive Filter with mask on the extracted V channel... and then Combine the transformed V channel with the original H and S channels...

Perhaps someone could confirm that the RGB color space model is the default color space for the Filter transform.
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: Subtractive filter and hue shifts

Post by couman »

Den,

I should have mentioned that I performed the calculations on the RGB values and then converted to H, S, and V.
Bob Coutant
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: Subtractive filter and hue shifts

Post by couman »

Darn, I don't see how to edit my previous post.

The calculation changes S and V but H seems to remain the same or nearly the same. [S is decreased and V is increased.]
Bob Coutant
JML
Posts: 44
Joined: April 25th, 2009, 9:47 am

Re: Subtractive filter and hue shifts

Post by JML »

Bob:

If x is a R, G, or B channel value, then the subtractive filter is computed as:

255 – ((255 – x)**2)/255

That is, the channel value is inverted, squared, normalized, then inverted again. The operation is performed on each channel. Note that 0 and 255 are fixed points and unchanged by the computation.

You can find the formula in the PWP Help for the Composite transformation but it is formulated in terms of compositing two images.

The transformation is a quadratic curve applied in RGB so shifts in saturation are certain where contrast is increased or decreased.

Gotta run,
Jim
couman
Posts: 82
Joined: April 25th, 2009, 8:44 am

Re: Subtractive filter and hue shifts

Post by couman »

Right Jim. I had initially thought that I should be seeing shifts in hue, but, for most of the cases I used, the shifts were insignificant.
Bob Coutant
Post Reply