[FFmpeg-devel] [PATCH] lavfi: add colorlevels filter
Paul B Mahol
onemda at gmail.com
Thu Dec 11 11:20:11 CET 2014
On 12/11/14, Lou Logan <lou at lrcd.com> wrote:
> Nice. A user was asking for this recently (can't remember where).
>
> On Wed, 10 Dec 2014 14:26:51 +0000, Paul B Mahol wrote:
>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>> doc/filters.texi | 41 +++++++
>> libavfilter/Makefile | 1 +
>> libavfilter/allfilters.c | 1 +
>> libavfilter/vf_colorlevels.c | 254
>> +++++++++++++++++++++++++++++++++++++++++++
>> 4 files changed, 297 insertions(+)
>> create mode 100644 libavfilter/vf_colorlevels.c
>>
>> diff --git a/doc/filters.texi b/doc/filters.texi
>> index 0ea3955..444dfda 100644
>> --- a/doc/filters.texi
>> +++ b/doc/filters.texi
>> @@ -2934,6 +2934,47 @@ colorbalance=rs=.3
>> @end example
>> @end itemize
>>
>> + at section colorlevels
>> +
>> +Adjust video input frames using levels.
>> +
>> +The filter accepts the following options:
>> +
>> + at table @option
>> + at item rimim
>
> rimin
Fixed.
>
>> + at item gimin
>> + at item bimin
>> + at item aimin
>> +Adjust red, green, blue and alpha input black point.
>> +Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are
>> @code{0}.
>
> How about a "master" point to control RGB all at once in case each value
> is the same for each component?
It can be added later.
>
>> + at item rimax
>> + at item gimax
>> + at item bimax
>> + at item aimax
>> +Adjust red, green, blue and alpha input white point.
>> +Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are
>> @code{1}.
>> +
>> +Input levels are used to lighten highlights (bright tones), darken
>> shadows
>> +(dark tones), change the balance of bright and dark tones.
>> +
>> + at item romim
>
> romin
Fixed.
>
>> + at item gomin
>> + at item bomin
>> + at item aomin
>> +Adjust red, green, blue and alpha output black point.
>> +Allowed ranges for options are @code{[0, 1.0]}. Defaults are @code{0}.
>> +
>> + at item romax
>> + at item gomax
>> + at item bomax
>> + at item aomax
>> +Adjust red, green, blue and alpha output white point.
>> +Allowed ranges for options are @code{[0, 1.0]}. Defaults are @code{1}.
>> +
>> +Output levels allows manual selection of a constrained output level
>> range.
>> + at end table
>> +
>
> I'd like to see an example or two in the docs.
>
I added 3 examples from you.
> Perhaps this filter could implement 'presets' and 'psfile' options for
> Photoshop levels preset files such as in curves filter. Attached is an
> example ALV file.
The preset could be added later. I could not decipher attached ALV file.
>
> Here are some of the PS presets and their values.
>
> Darker:
> rimin=0.0588235294:gimin=0.0588235294:bimin=0.0588235294
>
> Increase Contrast 1:
> rimin=0.0392156863:gimin=0.0392156863:bimin=0.0392156863:rimax=0.9607843137:gimax=0.9607843137:bimax=0.9607843137
>
> Increase Contrast 2:
> rimin=0.0784313725:gimin=0.0784313725:bimin=0.0784313725:rimax=0.9215686275:gimax=0.9215686275:bimax=0.9215686275
>
> Increase Contrast 3:
> rimin=0.1176470588:gimin=0.1176470588:bimin=0.1176470588:rimax=0.8823529412:gimax=0.8823529412:bimax=0.8823529412
>
> Lighter:
> rimax=0.9019607843:gimax=0.9019607843:bimax=0.9019607843
>
> I didn't figure out Lighten Shadows, Midtones Brighter, and Midtones
> Darker. Maybe I'll look again later.
More information about the ffmpeg-devel
mailing list