Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Does PHP support APNG files?

Apparently all the major popular browsers support the APNG format (https://caniuse.com/?search=apng).

PHP graphics functions (imagecreatefrom… and image…) don’t include specific functions for the APNG format. However, APNG is designed to masquerade as PNG.

So, the question is whether it’s ok to use the PNG functions with APNG files.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If I google it I find the APNG File Format. Here it says:

APNG files are stored as binary files on disc and use the extended
specifications of PNG for animated images. The first frame of an APNG
file is a normal PNG stream that is readable by PNG decoders for
display.

So you can use the PHP PNG functions with APNG files but they will only operate on the first frame of the animation.

To use all of the frames in an animated PNG file, I would suggest to to use one of the ImageMagick extensions.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading