[FFmpeg-devel] [PATCH] lavfi: add colorlevels filter

Michael Niedermayer michaelni at gmx.at
Thu Dec 11 13:13:26 CET 2014


On Thu, Dec 11, 2014 at 11:41:42AM +0100, Clément Bœsch wrote:
> On Wed, Dec 10, 2014 at 02:26:51PM +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
> > + 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}.
> > +
> > + 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
> > + 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
> > +
> 
> One of the most common usage for the color levels is to have an automatic
> adjustment of the range on the luma level.
> 
> Typically, doing this: https://lut.im/OiNweWNU/MraUtDBe using a threshold
> on both side.
> 
> Maybe you want to add such feature later thought.

btw, libpostproc supports auto levels, -vf pp=al


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141211/84011bc2/attachment.asc>


More information about the ffmpeg-devel mailing list