Re: Brightness filter in CSS Filters spec is wrong?

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)


Rik

On Tue, Jan 24, 2012 at 10:26 AM, Chris Marrin <cmarrin@apple.com> wrote:
>
> On Sat, Jan 21, 2012 at 4:37 PM, Rik Cabanier <cabanier@gmail.com> wrote:
>
>> Hi Chris,
>>
>> I agree that the current definition looks incorrect.
>> To give you one more option, Flash also provides a brightness filter that
>> uses a colormatrix. It seems to provide what you're looking for since it
>> will darken and brighten the result.
>>
>> For brightness settings that are negative (= darken), the formula is:
>>
>> color.rgb * (1-brightness)
>>
>> So, for rgb of (0, 255, 64) and brightness of -25%, the end result is (0,
>> 191, 48)
>>
>> For positive brightness (= lighten), the formula is:
>>
>> color.rgb * (1-brightness) + vec3(brightness)
>>
>> So, for rgb of (0, 255, 64) and brightness of 25%, the end result is (64,
>> 255, 112)
>>
>
> I know that many image editors (including Preview and iPhoto) have
> replaced brightness adjustments with separate lighten and darken filters.
> We could add those, but I think brightness as an additive effect is still
> useful. In its current incarnation, as a pure multiplication, it's not very
> useful. I won't comment on whether lighten/darken or brightness are more
> useful. But if you do the former, you need to have both to be able to have
> sufficient control.
>
>

Received on Tuesday, 24 January 2012 19:06:10 UTC