Skip to content
Advertisement

How can I split animated PNG with PHP?

There are a lot of solutions about how to create an APNG image (animated PNG), but how can I split APNG image frames into separate images?

Thanks in advance.

Advertisement

Answer

Here’s some example code that will take a png in the form of a byte array and return the various frames as an array of byte arrays.

JavaScript

An example call, loading a file and saving the parts:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement