[FFmpeg-user] PNGs with transparent pixels to GIF
MediaMouth
communque at gmail.com
Sun Dec 20 21:48:24 EET 2020
> On Dec 20, 2020, at 11:37 AM, pdr0 <pdr0 at shaw.ca> wrote:
>
> https://ffmpeg.org/ffmpeg.html#Complex-filtergraphs
>
> filter_complex "connects" multiple inputs and/or outputs. The names in
> brackets are named input or output "pads". They are similar to variable
> names . eg. [PG] could have been called [label1]. [0:v] means 1st file
> (numbering starts with zero), video stream. Similary [0:a] would mean first
> file, audio stream . There are reserved syntax for video and audio streams.
> This should be in the documetantion on stream numbering
>
> The first input node is omitted because there is only one input into the
> filter graph. The output node is also omitted, because there is only 1
> choice of output. This really means [out]
>
> -filter_complex "[0:v]palettegen[PG],[0:v][PG]paletteuse[out]" -map [out]
Thanks for taking the time. Clear and helpful. Much appreciated.
> I don't see the attachment, but 2 common artifacts for gif in general are
> quantization artifacts (gif only has 256 colors max), and the alpha channel
> can look very poor and binarized. Or dithering artifacts. There are
> different algorithms for dithering
In this case the "artifact" I was referring to was a piece of the opaque image itself that remains on all frames of the GIF even though it does not appear in the source PNGs
I posted the ZIP file of the source PNGs and resulting GIF here <https://drive.google.com/file/d/1Eu1Qy8LWHrcanwtn84Klwh-k4IZtM4Na/view?usp=sharing> if that helps.
Here's the reference CLI again, used to convert the PNGS to GIF:
> ffmpeg -i PngSeq/Frame_%05d.png -framerate 12 -filter_complex "palettegen[PG],[0:v][PG]paletteuse" PngSeq.gif
More information about the ffmpeg-user
mailing list