Opened 3 years ago

Closed 18 months ago

Last modified 18 months ago

#6813 closed defect (fixed)

Transparency broken when encoding animated gif

Reported by: cehoyos Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: gif alpha webp animated
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


$ ffmpeg -i transparency.apng out.gif
ffmpeg version N-88605-g991eca0 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --cc=/usr/local/gcc-6.3.0/bin/gcc
  libavutil      56.  0.100 / 56.  0.100
  libavcodec     58.  1.100 / 58.  1.100
  libavformat    58.  2.100 / 58.  2.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  0.101 /  7.  0.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, apng, from 'transparency.apng':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: apng, pal8(pc), 300x180, 4 fps, 4 tbr, 100k tbn, 100k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (apng (native) -> gif (native))
Press [q] to stop, [?] for help
Output #0, gif, to 'out.gif':
    encoder         : Lavf58.2.100
    Stream #0:0: Video: gif, pal8, 300x180, q=2-31, 200 kb/s, 4 fps, 100 tbn, 4 tbc
      encoder         : Lavc58.1.100 gif
frame=   93 fps=0.0 q=-0.0 Lsize=    1190kB time=00:00:23.01 bitrate= 423.5kbits/s speed= 473x
video:1188kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.126995%

Output file is broken.

Attachments (1)

transparency.apng (1.1 MB) - added by cehoyos 3 years ago.

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by cehoyos

comment:1 Changed 3 years ago by fractalawareness

Is there any workaround for this issue?

comment:2 Changed 2 years ago by stasjs

this fix could make life of a whole team easier, please help us!

comment:3 follow-up: Changed 2 years ago by cehoyos

I believe this patch allows encoding animated gifs with transparency:

comment:4 in reply to: ↑ 3 Changed 2 years ago by fractalawareness

Replying to cehoyos:

I believe this patch allows encoding animated gifs with transparency:

I'm using the latest nightly static build ffmpeg version N-91330-ga990184007 available from and still getting no transparency in gifs from apng or mov with alpha channel.

comment:6 Changed 2 years ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

comment:7 Changed 18 months ago by nireldidi

  • Cc added
  • Keywords webp animated added
  • Priority changed from normal to important
  • Resolution fixed deleted
  • Status changed from closed to reopened

It's still doesn't work for animated webp :/

ffmpeg -i test.gif animation.webp

For example, I want to convert this gif - to webP,

The output for now is -

how can I achieve that using ffmpeg?

comment:8 Changed 18 months ago by richardpl

  • Resolution set to invalid
  • Status changed from reopened to closed

comment:9 Changed 18 months ago by richardpl

  • Resolution changed from invalid to fixed

Please do not reopen this ticket with unrelated bug.

Note: See TracTickets for help on using tickets.