W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2012

Re: Brightness filter in CSS Filters spec is wrong?

From: Rik Cabanier <cabanier@gmail.com>
Date: Wed, 25 Jan 2012 01:42:41 -0800
Message-ID: <CAGN7qDBCwfiH_iLpQcK6mD6AunRBbNCrR2ha4bi9JCVARSGzaQ@mail.gmail.com>
To: Chris Marrin <cmarrin@apple.com>
Cc: public-fx@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 January 2012 09:43:10 GMT