Page 1 of 1

Subtractive filter and hue shifts

Posted: July 22nd, 2009, 8:20 pm
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?

Re: Subtractive filter and hue shifts

Posted: July 22nd, 2009, 8:45 pm
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.

Re: Subtractive filter and hue shifts

Posted: July 22nd, 2009, 10:27 pm
by couman
Den,

I should have mentioned that I performed the calculations on the RGB values and then converted to H, S, and V.

Re: Subtractive filter and hue shifts

Posted: July 22nd, 2009, 10:35 pm
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.]

Re: Subtractive filter and hue shifts

Posted: July 23rd, 2009, 10:48 am
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

Re: Subtractive filter and hue shifts

Posted: July 23rd, 2009, 11:27 am
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.