{"id":"image-x-png","mimeType":"image/x-png","name":"Portable Network Graphics (Legacy MIME)","shortName":"PNG","category":"Web Graphics","extensions":[".png"],"description":"The image/x-png MIME type is a legacy, non-standard alias for the Portable Network Graphics (PNG) format. It was historically generated by early versions of Microsoft Internet Explorer (specifically IE 4, 5, and 6) during file uploads before the official 'image/png' MIME type was fully standardized and adopted. The underlying file format is identical to a standard PNG—a robust, lossless, chunk-based image format supporting 8-bit alpha transparency. While modern web servers and browsers strictly use 'image/png', developers handling legacy systems or processing user file uploads must frequently account for 'image/x-png' to prevent unexpected validation failures.","seo":{"title":"image/x-png MIME Type | Developer Reference for Legacy PNGs","description":"Complete reference for the image/x-png MIME type: legacy Internet Explorer file uploads, PNG format aliases, MIME normalization, and backend validation.","faqs":[{"question":"What is the difference between image/png and image/x-png?","answer":"There is absolutely no difference in the actual image file. The 'image/png' string is the official IANA standard MIME type. The 'image/x-png' string was a temporary, experimental designation used primarily by old versions of Internet Explorer when uploading files to a server."},{"question":"Why is my server receiving image/x-png files?","answer":"If a user is browsing your site with an extremely old browser (like Internet Explorer 6) or using a legacy enterprise application to submit HTTP POST requests, the client's internal registry may still map .png files to the image/x-png MIME type."},{"question":"Should I allow image/x-png in my file upload validator?","answer":"Yes, but you should instantly normalize it. When your backend receives 'image/x-png', you should programmatically rewrite the MIME string in your database and storage logic to 'image/png' to maintain consistency and avoid future compatibility issues."}]},"index":{"compression":["Deflate (Lossless)"],"browserSupport":{"score":5,"label":"Excellent"},"commonUses":["Legacy Internet Explorer File Uploads","Older ASP/PHP Web Applications","Lossless Web Graphics"]},"technical":{"magicBytes":{"hex":"89 50 4E 47 0D 0A 1A 0A","ascii":"\\x89PNG\\r\\n\\x1A\\n"},"container":"PNG Chunk Structure (IHDR, IDAT, IEND)","compressionAlgorithm":["Deflate (LZ77)"],"colorDepth":["1-bit to 16-bit (Grayscale)","8-bit (Indexed Palette)","24-bit (True Color)","32-bit (True Color with Alpha)","48-bit (High Color)","64-bit (High Color with Alpha)"],"transparency":true,"animation":false,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":true,"hdrSupport":true},"history":{"developer":"PNG Development Group","released":"1996","specification":"ISO/IEC 15948:2004 (Standard PNG)"},"browserSupport":{"chrome":true,"chromeVersion":"1","firefox":true,"firefoxVersion":"1","safari":true,"safariVersion":"1","edge":true,"edgeVersion":"12","internetExplorer":true},"softwareSupport":[{"name":"Standard Web Browsers","logo":""},{"name":"Adobe Photoshop","logo":""},{"name":"ImageMagick","logo":"image-magic.webp"},{"name":"GIMP","logo":"gimp.svg"}],"conversion":{"convertTo":["webp","jpeg","avif","svg"],"convertFrom":["jpeg","webp","gif"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/png"},{"header":"Content-Type","value":"image/x-png"}],"htmlAccept":"image/png, image/x-png, .png","fileDetection":["Because the file is a standard PNG, check the first 8 bytes for the universal PNG signature (Hex: 89 50 4E 47 0D 0A 1A 0A).","When evaluating MIME types from HTTP multipart form uploads (e.g., $_FILES in PHP), map 'image/x-png' explicitly to 'image/png' before saving to the database."]},"prosCons":{"pros":["The underlying format provides flawless, lossless compression and perfect 8-bit alpha channel transparency","Universally supported by every modern operating system, image editor, and web browser"],"cons":["The 'image/x-png' string is an obsolete vendor quirk that forces backend developers to write redundant normalization logic in file upload scripts","If left unnormalized, strict MIME validators or content security policies on modern systems may incorrectly reject valid PNG files"]},"specifications":{"url":"https://www.w3.org/TR/PNG/","rfc":"RFC 2083","mimeAliases":["image/png"]},"developerSnippets":{"python":"import magic\n# Modern Libmagic will output the standardized 'image/png' rather than the legacy 'x-png'\nprint(magic.from_file('graphic.png', mime=True)) # Outputs 'image/png'","nodejs":"const mime = require('mime');\n// JS libraries resolve .png strictly to the IANA standard image/png\nconsole.log(mime.getType('graphic.png')); // Outputs 'image/png'","go":"import (\n    \"bytes\"\n    \"net/http\"\n)\n// Native Go HTTP detection reads the PNG magic bytes and returns the standard MIME\n// mime := http.DetectContentType(buf) // Returns \"image/png\"","php":"// Example of normalizing the legacy MIME type during a file upload in PHP\n$mime = $_FILES['upload']['type'];\nif ($mime === 'image/x-png') {\n    $mime = 'image/png';\n}\necho $mime;"},"relatedFormats":["png","webp","avif","jpeg"]}
