[FFmpeg-devel] [PATCH] Revert "avfilter/vf_palette(gen|use): support palettes with alpha"

Soft Works softworkz at hotmail.com
Mon Oct 31 00:55:31 EET 2022



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Soft Works
> Sent: Sunday, October 30, 2022 10:41 PM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] Revert
> "avfilter/vf_palette(gen|use): support palettes with alpha"
> 
> 
> 
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> > Clément Bœsch
> > Sent: Sunday, October 30, 2022 10:30 PM
> > To: FFmpeg development discussions and patches <ffmpeg-
> > devel at ffmpeg.org>
> > Subject: Re: [FFmpeg-devel] [PATCH] Revert
> > "avfilter/vf_palette(gen|use): support palettes with alpha"
> >
> > On Sun, Oct 30, 2022 at 09:19:05PM +0000, Soft Works wrote:
> > [...]
> > > At the time of submission I did a lot of experiments and the
> > results
> > > seemed to be very useful:
> > >
> > >
> https://gist.github.com/softworkz/deef5c2a43d3d629c3e17f9e21544a8f
> > >
> >
> > On that page, the result of the command using palette* filters for
> > the
> > colored "O" gives a broken output, and it's not a simple bug, it's
> > more
> > fundamental. You cannot just just average the colors with different
> > levels
> > of alpha, it makes no sense.
> >
> > Do you understand why or do you need me to elaborate?
> 
> I understand why. I know that it's not perfect. But it's the best
> what's achievable within the way the filter is working.
> 
> But I wouldn't go that far as saying it would be "broken". I think
> the result is quite acceptable with regards to the method being
> using.
> 
> The patch I had submitted doesn't change the previous behavior
> without the use_alpha parameter.
> And when using the use_alpha parameter, the results are still
> useful in many cases - maybe not always.
> 
> But it don't see any reason to remove this just because it's not
> perfect. If you would have a patch to improve the results - that
> would be a different story and of course very welcome.

I'm really not an expert in image processing algorithms, and I 
haven't tried the following yet:
Do you think it might make sense to put more weight on the 
alpha value by tripling it? So it would be weighted equally to the 
RGB value?

softworkz




More information about the ffmpeg-devel mailing list