Question

Has anyone used the photo filter in Photoshop? Edit > Adjustments > Photo Filter...

It produces a really nice image tint that I've been unable to reproduce with blending modes. Has anyone got any idea of the pixel maths behind this filter? - So I can build a shader based on it.

It seems to basically be a luminosity preserving colour tint.

Has variables: Color, Amount and Preserve Luminosity.

Any ideas?

Was it helpful?

Solution

Filters (in light) are multiplicative, as in:

red_filter = ( 1 , 0 , 0 ) * color

I don't think any blend-modes exist for it, since any transparent overlay with that system would darken the image to some degree.

OTHER TIPS

It's incredibly simple, but if anyone wants the hlsl code for this:

// Photoshop PhotoFilter style effect.

// Input filter color.
float4 FilterColor;

// Implicit texture sampler.
sampler TextureSampler : register(s0);

float4 PhotoFilter(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
    return tex2D(TextureSampler, texCoord) * FilterColor;
}

technique GeneralEffect
{
    pass Pass1
    {
        PixelShader = compile ps_2_0 PhotoFilter();
    }

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top