How can I convert animated PNG (APNG) into animated WEBP?

72 views
Skip to first unread message

Furkan Gözükara

unread,
Jun 17, 2021, 3:14:16 PMJun 17
to WebP Discussion
I have tried to find through documents but I have failed

What I want is converting an animated PNG (APNG) image into animated WEBP image

I want it to be lossless and maximum compression (so CPU time, memory requirement etc. is unimportant)

How can I do that?

Moreover, I have used the belong command to convert regular PNG into WEBP image

Is this the correct way to convert static PNG into lossless and best compressed WEBP?

Thank you very much for answers 

cwebp.exe -lossless -q 100 -z 9 -m 6 -mt  a.png -o a2.webp


James Zern

unread,
Jun 17, 2021, 10:05:28 PMJun 17
to WebP Discussion
Hi,

On Thu, Jun 17, 2021 at 12:14 PM Furkan Gözükara <monste...@gmail.com> wrote:
I have tried to find through documents but I have failed

What I want is converting an animated PNG (APNG) image into animated WEBP image

I want it to be lossless and maximum compression (so CPU time, memory requirement etc. is unimportant)

How can I do that?

We don't have anything in libwebp at the moment like gif2webp to support animated png directly. Recent versions of ImageMagick support APNG, however [1]. Another, more manual, option would be to use tools like ImageMagick or apngdis to disassemble the apng and then reassemble it with img2webp [2].
 

Moreover, I have used the belong command to convert regular PNG into WEBP image

Is this the correct way to convert static PNG into lossless and best compressed WEBP?

Thank you very much for answers 

cwebp.exe -lossless -q 100 -z 9 -m 6 -mt  a.png -o a2.webp

Furkan Gözükara

unread,
Jun 18, 2021, 4:45:26 AMJun 18
to WebP Discussion, James Zern
James ty for answer. There is a website that does convert APNG into WEBP. How they do it?

Can you help me with  disassemble  and  reassemble  part? How to do it properly? Keep frame count timing etc?

James Zern

unread,
Jun 18, 2021, 2:13:25 PMJun 18
to WebP Discussion
On Fri, Jun 18, 2021 at 1:45 AM Furkan Gözükara <monste...@gmail.com> wrote:
James ty for answer. There is a website that does convert APNG into WEBP. How they do it?

I won't be able to comment on individual sites, but do you have a reference? From my earlier examples you can see there's more than one way to do it using various tools or the library APIs directly.
 

Can you help me with  disassemble  and  reassemble  part? How to do it properly? Keep frame count timing etc?

This is where the manual part of my comment comes in, it would probably be better to investigate the automatic conversion with ImageMagick. apngdis will produce individual frames and a corresponding text file (e.g., apngframe01.png, apngframe01.txt, apngframe02.png ...). The text file contains the delay information which could be translated to input for the img2webp command for instance.

Furkan Gözükara

unread,
Jun 19, 2021, 4:58:42 PMJun 19
to WebP Discussion, James Zern
Here individual website : https://ezgif.com/apng-to-webp

I also have found a library but it is very outdated :/ : https://github.com/Benny-/apng2webp/releases

James Zern

unread,
Jun 21, 2021, 4:48:55 PMJun 21
to WebP Discussion
On Sat, Jun 19, 2021 at 5:15 AM Furkan Gözükara <monste...@gmail.com> wrote:
Here individual website : https://ezgif.com/apng-to-webp

Thanks from the link. You can see on the about page the site is using a combination of some of the tools I mentioned: https://ezgif.com/about.
Reply all
Reply to author
Forward
0 new messages