{"id":"image-avif","mimeType":"image/avif","name":"AV1 Image File Format","shortName":"AVIF","category":"Web","extensions":[".avif"],"description":"AVIF is a next-generation image format based on the AV1 video codec, delivering exceptional compression efficiency and support for HDR, wide color gamut, and animation — significantly outperforming both JPEG and WebP in quality-to-size ratio.","seo":{"title":"image/avif MIME Type | Complete Developer Reference \u0026 Magic Bytes","description":"Complete reference for the image/avif MIME type: magic bytes, browser support matrix, HTTP headers, developer snippets, and technical specifications for AVIF.","faqs":[{"question":"What is the magic byte for AVIF?","answer":"AVIF uses the ISOBMFF container. The signature starts with a variable-length box size, followed by 66 74 79 70 61 76 69 66 (ftypavif). Full hex: XX XX XX XX 66 74 79 70 61 76 69 66."},{"question":"Is AVIF better than WebP?","answer":"AVIF generally provides 20–50% better compression than WebP at equivalent visual quality, especially at lower bitrates. However, AVIF encoding is significantly slower and browser support, while growing, is slightly behind WebP."},{"question":"Does AVIF support HDR?","answer":"Yes, AVIF natively supports HDR (High Dynamic Range) and wide color gamuts including BT.2020, making it ideal for modern photography and display-quality images."}]},"index":{"compression":["AV1 Lossy","AV1 Lossless"],"browserSupport":{"score":4,"label":"Very Good"},"commonUses":["Next-Gen Websites","HDR Photography","High-Quality Web Images"]},"technical":{"magicBytes":{"hex":"XX XX XX XX 66 74 79 70 61 76 69 66","ascii":"....ftypavif"},"container":"HEIF / ISOBMFF","compressionAlgorithm":["AV1"],"colorDepth":["8-bit","10-bit","12-bit"],"transparency":true,"animation":true,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":false,"hdrSupport":true},"history":{"developer":"Alliance for Open Media (AOMedia)","released":"2019","specification":"AV1 Image File Format (AVIF)"},"browserSupport":{"chrome":true,"chromeVersion":"85+","firefox":true,"firefoxVersion":"93+","safari":true,"safariVersion":"16+","edge":true,"edgeVersion":"121+","internetExplorer":false},"softwareSupport":[{"name":"Google Chrome","logo":"chrome.svg"},{"name":"Mozilla Firefox","logo":"firefox.svg"},{"name":"Apple Safari","logo":"safari.svg"},{"name":"GIMP 2.10+","logo":"gimp.svg"},{"name":"ImageMagick 7.0.25+","logo":"image-magic.webp"},{"name":"Squoosh","logo":"Squoosh.svg"},{"name":"Cloudinary","logo":"Cloudinary_logo.svg"}],"conversion":{"convertTo":["jpeg","png","webp"],"convertFrom":["jpeg","png","webp","heic"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/avif"}],"htmlAccept":"image/avif","fileDetection":["Check for ISOBMFF 'ftyp' box at offset 4","Verify 'avif' or 'avis' brand string at offset 8"]},"prosCons":{"pros":["Best-in-class compression — typically 20–50% smaller than WebP at equivalent quality","Native HDR and wide color gamut (BT.2020) support","Supports 8, 10, and 12-bit color depth"],"cons":["Encoding is highly CPU-intensive — significantly slower than JPEG or WebP","Requires Edge 121+ (not supported in earlier Edge versions)","Limited support in native desktop image viewers"]},"specifications":{"url":"https://aomediacodec.github.io/av1-avif/","rfc":"","mimeAliases":[]},"developerSnippets":{"python":"import magic\nprint(magic.from_file('file.avif', mime=True)) # Outputs 'image/avif'","nodejs":"const FileType = require('file-type');\nconst type = await FileType.fromFile('file.avif');\nconsole.log(type.mime); // image/avif","go":"// Go standard library doesn't detect AVIF natively.\n// Use github.com/h2non/filetype instead:\nkind, _ := filetype.Match(buf)\nfmt.Println(kind.MIME.Value) // image/avif","php":"$mime = mime_content_type('file.avif');\necho $mime; // image/avif"},"relatedFormats":["webp","heic","jpeg"]}
