{"id":"image-heif","mimeType":"image/heif","name":"High Efficiency Image File Format","shortName":"HEIF","category":"Photography","extensions":[".heif",".hif"],"description":"HEIF (High Efficiency Image File Format) is a flexible container format for individual images and image sequences. Developed by MPEG, it supports various compression codecs (like HEVC, AVC, and JPEG), and provides advanced features such as alpha channels, depth maps, and rich metadata.","seo":{"title":"image/heif MIME Type | Complete Developer Reference \u0026 Magic Bytes","description":"Complete reference for the image/heif MIME type: magic bytes, browser support matrix, HTTP headers, developer snippets, and technical specifications for the HEIF container.","faqs":[{"question":"What is the difference between HEIF and HEIC?","answer":"HEIF is the overarching container format (based on ISOBMFF) that can encapsulate various types of image data. HEIC is a specific, highly popular implementation of HEIF where the images are strictly encoded using the HEVC (H.265) video codec."},{"question":"What is the magic byte for HEIF?","answer":"HEIF files utilize the ISOBMFF container structure. They begin with a 4-byte box size, followed by the 'ftyp' box identifier, and typically a major brand like 'mif1' (for still images) or 'msf1' (for sequences). The hex representation for a standard still HEIF is XX XX XX XX 66 74 79 70 6D 69 66 31 (....ftypmif1)."},{"question":"Do web browsers support HEIF?","answer":"Native support for general HEIF files in web browsers is almost non-existent. While Apple's Safari supports HEIC (HEVC-encoded HEIF), other browsers like Chrome, Edge, and Firefox do not natively support HEIF containers due to the complex licensing of underlying codecs."}]},"index":{"compression":["Lossy","Lossless"],"browserSupport":{"score":1,"label":"None"},"commonUses":["Digital Photography","Camera Capture","Image Archiving","Multi-image composites"]},"technical":{"magicBytes":{"hex":"XX XX XX XX 66 74 79 70 6D 69 66 31","ascii":"....ftypmif1"},"container":"HEIF / ISOBMFF (ISO/IEC 14496-12)","compressionAlgorithm":["Codec Agnostic (HEVC, AVC, JPEG, AV1)"],"colorDepth":["8-bit","10-bit","12-bit","16-bit"],"transparency":true,"animation":true,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":false,"hdrSupport":true},"history":{"developer":"Moving Picture Experts Group (MPEG)","released":"2015","specification":"ISO/IEC 23008-12 (MPEG-H Part 12)"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"Apple Photos","logo":""},{"name":"Windows Photos (with HEIF Extension)","logo":""},{"name":"Adobe Photoshop","logo":""},{"name":"ImageMagick","logo":"image-magic.webp"},{"name":"GIMP","logo":"gimp.svg"}],"conversion":{"convertTo":["jpeg","png","webp","avif"],"convertFrom":["jpeg","png"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/heif"}],"htmlAccept":"image/heif, .heif, .hif","fileDetection":["Check for ISOBMFF 'ftyp' box starting at byte offset 4","Verify general HEIF brand strings like 'mif1' or 'msf1' starting at byte offset 8"]},"prosCons":{"pros":["Highly flexible container that can store image bursts, animations, focal stacks, and stereo 3D images in one file","Natively supports depth maps and alpha channels, making it perfect for computational photography","When paired with modern codecs like HEVC or AV1, it provides massive storage savings over legacy formats like JPEG"],"cons":["Codec agnosticism makes broad software decoding difficult, as the container might hold proprietary or unsupported codecs","Zero cross-platform web browser support, requiring conversion for online publishing","Often confused with the more specific 'image/heic' and 'image/avif' MIME types"]},"specifications":{"url":"https://www.iso.org/standard/89035.html","rfc":"","mimeAliases":["image/heic","image/avic"]},"developerSnippets":{"python":"import magic\nprint(magic.from_file('image.heif', mime=True)) # Outputs 'image/heif'","nodejs":"const FileType = require('file-type');\nconst type = await FileType.fromFile('image.heif');\nconsole.log(type.mime); // image/heif","go":"import \"net/http\"\n\n// The standard net/http library struggles with HEIF. \n// Specialized ISOBMFF parsing is required to read the 'mif1' brand.","php":"$mime = mime_content_type('image.heif');\necho $mime; // Standard servers often require an updated magic database to properly detect HEIF"},"relatedFormats":["heic","avif","heif-sequence","jpeg"]}
