Page MenuHomePhabricator

Better APNG resizing
Open, LowPublicFeature

Description

Author: lshyamal

Description:
Animated PNG (APNG) is not supported by all browsers but even on browsers that support it, animation fails when the image is not shown at original size.

Apparently the resizing for the remaining frames fails.

One developer notes that it can be fixed by dissasembling, resizing and assembling the frames
http://ruedigergad.com/2013/08/03/note-to-self-resize-animated-png-apng/

./apngdis animated.png
for i in *png ; do convert $i -resize 32x32\< $i ; done
./apngasm output.png apngframe00.png 1 25 /f


Version: 1.23.0
Severity: enhancement
See also: T290345: Create thumbnail for animated WebP files

Details

Reference
bz62146

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:52 AM
bzimport set Reference to bz62146.
bzimport added a subscriber: Unknown Object (MLST).

Could you please provide an example link to APNG uploaded to Commons, or such?

https://commons.wikimedia.org/wiki/File:Animated_PNG_example_bouncing_beach_ball.png

(As comment 0 says, we strip animation on resize, and only firefox will show it animated. All apng files will have a warning on their page about lack of animation in resize)

lshyamal wrote:

(In reply to Andre Klapper from comment #1)

Could you please provide an example link to APNG uploaded to Commons, or
such?

Any of the larger files on https://commons.wikimedia.org/wiki/Category:Animated_PNG

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM

As of ImageMagick 7.0.10-31, Animated PNG is supported

Note, you must use an explicit image format specifier to read an APNG (apng:myImage.apng) image sequence, otherwise it assumes a PNG image and only reads the first frame.

I haven't tested this yet, but someone could verify that this is indeed how to do it, and check if it is needed on both input and/or output and then adapt the converter.