What is the APNG File Format?
Animated PNG, or APNG, extends PNG with multiple frames, frame timing, and looping. It retains full-color pixels and alpha transparency rather than using GIF’s restricted palette model.
How the APNG File Format works
Animated PNG began as a Mozilla extension and became part of the official PNG specification with its Third Edition, a W3C Recommendation since June 2025. An APNG stream is a normal PNG stream plus three chunk types: acTL declares the animation and gives the frame count and number of plays (0 means loop indefinitely), fcTL describes one frame, and fdAT carries frame data in the same form as IDAT with a sequence number in front. Every frame is losslessly compressed and uses the same bit depth, color type, and palette as the static image, so an APNG can be truecolor with full alpha or palette-based. A frame may cover only part of the canvas: its fcTL chunk gives a width, height, and offset inside the image dimensions.
Key facts
- 1An APNG cannot be told from a PNG by its signature or, in practice, its name. Both start with the same eight bytes, and although
image/apngand.apngare registered, MDN lists.pngas an APNG extension too. What marks a file as animated is anacTLchunk before the firstIDATchunk. To find it, walk the chunks after the signature: each starts with a four-byte data length and a four-byte type, followed by the data and a four-byte CRC. - 2A decoder without APNG support ignores the animation chunks and shows the static image. That image is the first animation frame only when a
fcTLchunk precedesIDAT; otherwise it is not part of the animation at all. The PNG specification warns that a file can pair an unrelated static image with its animation and that this could be used to bypass moderation, so review or thumbnail the animation frames, not only the static image. - 3Frames are instructions for updating a canvas, not always complete pictures. Each
fcTLchunk setsdispose_op(leave the region, clear it to transparent black, or restore the previous contents) andblend_op(replace the region or alpha-composite over it). A tool that copies a frame’s data out as a standalone image, or re-encodes frames, without applying these rules can output partial or wrongly composited images. Delays are fractions of a second (delay_numoverdelay_den, with a zero denominator read as 100); a zero numerator asks for the next frame as fast as possible, and viewers may impose a lower bound. - 4Reading every frame is often opt-in. ImageMagick’s format list says an APNG must be read with an explicit
apng:prefix, otherwise it “assumes a PNG image and only reads the first frame”, and thatffmpegmust be on the path. Read as a plain PNG, the file yields its static image under the PNG specification, so that “first frame” is not necessarily part of the animation. sharp has an open feature request for APNG and a user report that only the first frame was resized. FFmpeg’s APNG demuxer ignores the file’s loop count by default (-ignore_loop), and its muxer sets repetition with-plays, where 0 loops forever.
When the APNG File Format matters
Use APNG for short interface animations, stickers, and loading indicators that need 24-bit color or an 8-bit alpha channel, which GIF’s 8-bit indexed color and single transparent color index cannot provide. APNG is lossless only, so expect large files for photographic or long animations; MDN’s format guide rates AVIF and WebP as better performing but less broadly supported. Current Chrome, Edge, Firefox, Opera, and Safari display APNG, and software without APNG support shows the file’s static image instead.
How Transloadit helps with the APNG File Format
Transloadit’s image formats table lists APNG as a format that its ImageMagick-based Robots, including /image/resize, can read and write, and its audio/video formats table lists an apng format that FFmpeg-based Robots such as /video/encode can read and write.
The tables report what each stack can read and write, not whether animation survives a given Step. The /image/resize documentation describes its frame and flatten parameters only for animated GIF and does not say how an APNG named .png is treated. No Assembly was run for this entry, so run a representative APNG through yours and check the frame count of the result.
Explore Transloadit’s file formats & compression capabilities
Sources
- W3C PNG Specification (Third Edition): APNG structure (4.9), signature and chunk layout (5.2–5.3), acTL, fcTL and fdAT chunks (11.3.6), image/apng registration and its security considerations (A.2)
- MDN: Image file type and format guide (APNG and GIF sections)
- Can I use: Animated PNG (APNG)
- ImageMagick image formats: APNG row (explicit apng: specifier, ffmpeg requirement)
- FFmpeg Formats Documentation: apng demuxer (3.3) and apng muxer (4.14)
- sharp issue #3195: resizing an APNG saved only the first frame
- sharp issue #2375: APNG support (open feature request)