What is MIME type "image/apng"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

The MIME type image/apng defines an animated image format. It builds on the traditional PNG standard by supporting multiple frames and timing controls for smooth motion.


Main use case: It is used to deliver high-quality web animations that include transparency and rich colors.



Files using this MIME type are typically saved with the PNG or APNG extensions. This format gives multimedia content a dynamic and modern look.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: image/apng    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="image/apng">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'image/apng');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

Should I use the .png or .apng file extension?

You should generally use the standard .png extension to ensure backward compatibility. If a viewer or browser does not support animation, it will treat the file as a standard static image and display the first frame. The .apng extension is valid but primarily used when you need to explicitly distinguish animated files from static ones on the file system.

Why is my APNG file not animating in the browser?

If an APNG is not animating, ensure you are using a modern browser (Chrome, Firefox, Safari, and Edge all support it). If the file is served with the wrong MIME type or the software viewing it only supports the static image/png standard, it will only show the first frame. Verify the file was actually saved as an animated format and not flattened.

What are the advantages of APNG over GIF?

APNG supports 24-bit color and 8-bit transparency (alpha channels), whereas image/gif is limited to 256 colors and 1-bit transparency. This means APNGs have no jagged edges around transparent areas and look significantly sharper on high-resolution displays, though the file size may be larger.

Do I need to configure my web server for image/apng?

If you use the .apng extension, you should configure your server to send the correct header. For Apache, add AddType image/apng .apng to your config or .htaccess. For Nginx, add image/apng apng; to your mime.types file. If you use the standard .png extension, the server will usually send image/png, which browsers handle correctly for animation anyway.

Is image/apng supported by all browsers?

It is supported by all major modern browsers, including Safari on iOS. Legacy browsers like Internet Explorer do not support the animation data; however, because the format extends the PNG standard, these browsers will simply display the first frame as a static image without breaking the layout.

How does APNG compare to animated WebP?

Animated image/webp generally offers better compression and smaller file sizes than APNG. However, APNG retains the unique advantage of backward compatibility with older software that reads standard PNGs. If maximum compatibility with legacy tools is a priority, APNG is often the better choice.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.