Re: Brightness filter in CSS Filters spec is wrong?

On Tue, Jan 24, 2012 at 4:12 PM, Chris Marrin <cmarrin@apple.com> wrote:

>
> On Jan 24, 2012, at 11:05 AM, Rik Cabanier wrote:
>
> Not sure I follow.
> so instead of brightness:
>
> -1 < brightness < 0 -> color.rgb * (1-brightness)
> 0 < brightness < 1 -> color.rgb * (1-brightness) + vec3(brightness)
>
>
> it would be:
>
> -1 < darken < 1 -> color.rgb * (1-darken)
> -1 < lighten < 1 -> color.rgb + vec3(lighten)
>
>
> Yes, that would give us a nice single filter for both brightening and
> darkening. But it's still a multiplicative (non-linear) operation which
> affects pixels differently based on their original value. A pixel value of
> 2 changes a lot less than a pixel value of 200. That's often useful,
> because it can make the light parts darker without affecting the dark parts
> as much. That's why brighten and darken exist. But it's not an additive
> (linear) approach, which brightens all pixels equally.
>
> I don't know which is better. But I have done the additive approach in
> WebKit and it is much more intuitive than the original, purely
> multiplicative approach.
>
> Your approach is much better since it allows brightening all the way to
> white, which the original approach didn't. But I'm not sure whether its
> better to be linear or non-linear in this case. One thing is that we
> already have a multiplicative filter, in contrast(). So maybe a
> multiplicative contrast filter and additive brightness filter is the best
> combination?
>
>
Technically, I agree that that would be best since you can combine them
but I'm not sure if this is very intuitive.
I wonder how common it is to just use the additive brightness filter.

I think this is where an expert comes in. I'll ask some people from the
Lightroom and Photoshop team for their input...

Rik

Received on Wednesday, 25 January 2012 09:43:09 UTC