image/png
The MIME type for PNG (Portable Network Graphics) image files with lossless compression.
What Is This?
The image/png MIME type indicates that the content is a PNG (Portable Network Graphics) image. PNG supports lossless compression, transparency (alpha channel), and is widely used for graphics, logos, screenshots, and images requiring sharp edges or transparency. Unlike JPEG, PNG does not introduce compression artifacts.
Common Uses
Common Use
Logos and icons requiring transparency
Common Use
Screenshots and UI mockups
Common Use
Graphics with sharp edges, text, and solid colors
Common Use
Images that need lossless quality preservation
Examples
Serve files with the image/png MIME type:
# Nginx
location ~ \.png$ {
add_header Content-Type "image/png";
}
# Apache
AddType image/png .pngUse this MIME type in HTML or HTTP:
Content-Type: image/png <!-- HTML reference --> <link rel="preload" href="file.png" as="fetch" crossorigin>
Related Entries
More from this reference:
image/jpeg
The MIME type for JPEG image files using lossy compression for photographs.
image/gif
The MIME type for GIF images supporting animation and transparency.
image/webp
The modern MIME type for WebP images offering superior compression for both lossy and lossless encoding.
image/svg+xml
The MIME type for SVG (Scalable Vector Graphics) vector images.
image/avif
The next-generation MIME type for AVIF images with advanced compression based on AV1 video codec.
Frequently Asked Questions
When should I use PNG instead of JPEG?
Use PNG for images with text, sharp edges, transparency, or areas of solid color (screenshots, logos, icons). Use JPEG for photographs and images with smooth gradients where some quality loss is acceptable for smaller file sizes.
Does PNG support animation?
Yes, but not natively in all browsers. APNG (Animated PNG) is supported in most modern browsers but is less common than GIF for animations. For animated content, consider using GIF or video formats instead.