skip to Main Content

I am very interested in the shadow/highlight filter in photoshop. Does anybody has any ideas about the algorithm behind the shadow/highlight filter?

3

Answers


    1. Create a new layer blending mode “soft light” with the 50% gray background.
    2. Select the “brush” with pressing a 4%.
    3. Press the “D”
      Black – shadow. White – highlight. To quickly change the second color – press the “X”

    I hope this is what you want

    Login or Signup to reply.
  1. I made a little 10-step wedge of various shades of black-white and went through the various values of Shadow in the Shadow and Highlight settings for you and animated the movie so you can see how the histogram is moving…

    enter image description here

    You can see as the Amount increases, the more the second histogram bar moves to the right. As the Tone increases, so more and more different shadow tones are affected.

    Login or Signup to reply.
  2. It is not accurate but imitates well.

    lumR = 0.299;
    lumG = 0.587;
    lumB = 0.114;
    
    // we have to find luminance of the pixel
    // here 0.0 <= source.r/source.g/source.b <= 1.0 
    // and 0.0 <= luminance <= 1.0
    
    luminance = sqrt( lumR*pow(source.r,2.0) + lumG*pow(source.g,2.0) + lumB*pow(source.b,2.0));
    
    
    
    // here highlights and and shadows are our desired filter amounts
    // highlights/shadows should be >= -1.0 and <= +1.0
    // highlights = shadows = 0.0 by default
    // you can change 0.05 and 8.0 according to your needs but okay for me
    
    h = highlights * 0.05 * ( pow(8.0, luminance) - 1.0 );
    s = shadows * 0.05 * ( pow(8.0, 1.0 - luminance) - 1.0 );
    
    output.r = source.r + h + s;
    output.g = source.g + h + s;
    output.b = source.b + h + s;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search