{"id":"image-gif","mimeType":"image/gif","name":"Graphics Interchange Format","shortName":"GIF","category":"Web","extensions":[".gif"],"description":"GIF (Graphics Interchange Format) is a widely supported bitmap image format introduced by CompuServe in 1987. It uses lossless LZW compression and is most famous for its widespread use in short, looping web animations, despite its limitation to a 256-color palette.","seo":{"title":"image/gif MIME Type | Complete Developer Reference \u0026 Magic Bytes","description":"Complete reference for the image/gif MIME type: magic bytes, browser support matrix, HTTP headers, developer snippets, and technical specifications for GIF.","faqs":[{"question":"What is the magic byte for GIF?","answer":"GIF files begin with either 'GIF87a' or 'GIF89a'. In hex, this signature corresponds to 47 49 46 38 37 61 or 47 49 46 38 39 61 at the very start of the file."},{"question":"Does GIF support transparency?","answer":"Yes, but only 1-bit transparency (introduced in GIF89a). This means a pixel is either fully transparent or fully opaque. It lacks the partial transparency (alpha channel) found in PNG or WebP, which often leads to jagged, un-aliased edges."},{"question":"Why do GIFs sometimes have poor color quality?","answer":"The standard GIF format is restricted to a maximum of 256 colors (8-bit) per frame. When converting complex images like photographs to GIF, the software must use color quantization and dithering, which often causes visible banding and graininess."}]},"index":{"compression":["Lossless (LZW)"],"browserSupport":{"score":5,"label":"Universal"},"commonUses":["Web Animations","Memes","Simple Graphics","Logos with flat colors"]},"technical":{"magicBytes":{"hex":"47 49 46 38 39 61","ascii":"GIF89a"},"container":"GIF","compressionAlgorithm":["LZW (Lempel-Ziv-Welch)"],"colorDepth":["1-bit","4-bit","8-bit (Indexed)"],"transparency":true,"animation":true,"metadata":{"exif":false,"xmp":true,"iccProfile":true},"alphaChannel":false,"progressiveLoading":true,"hdrSupport":false},"history":{"developer":"CompuServe","released":"1987","specification":"GIF89a Specification"},"browserSupport":{"chrome":true,"chromeVersion":"All","firefox":true,"firefoxVersion":"All","safari":true,"safariVersion":"All","edge":true,"edgeVersion":"All","internetExplorer":true},"softwareSupport":[{"name":"Adobe Photoshop","logo":""},{"name":"GIMP","logo":"gimp.svg"},{"name":"ImageMagick","logo":"image-magic.webp"},{"name":"EZGIF","logo":""},{"name":"Adobe After Effects","logo":""}],"conversion":{"convertTo":["webp","apng","png","jpeg"],"convertFrom":["webp","apng","png","jpeg","mov"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/gif"}],"htmlAccept":"image/gif, .gif","fileDetection":["Check first 6 bytes for the 'GIF87a' (47 49 46 38 37 61) or 'GIF89a' (47 49 46 38 39 61) string"]},"prosCons":{"pros":["Universal support across all web browsers, operating systems, and messaging apps","Supports basic frame-by-frame animation out of the box","Lossless compression is highly effective for simple, flat-color graphics like logos or pixel art"],"cons":["Limited to 256 colors per frame, resulting in poor quality for complex gradients and photographs","Animations produce massive file sizes compared to modern formats like MP4, WebP, or AVIF","1-bit transparency limits edge blending on non-uniform backgrounds"]},"specifications":{"url":"https://www.w3.org/Graphics/GIF/spec-gif89a.txt","rfc":"","mimeAliases":[]},"developerSnippets":{"python":"import imghdr\nprint(imghdr.what('animation.gif')) # Outputs 'gif'","nodejs":"const FileType = require('file-type');\nconst type = await FileType.fromFile('animation.gif');\nconsole.log(type.mime); // image/gif","go":"import \"net/http\"\n\nmimeType := http.DetectContentType(fileBytes)\nfmt.Println(mimeType) // image/gif","php":"$mime = mime_content_type('animation.gif');\necho $mime; // image/gif"},"relatedFormats":["apng","webp","png"]}
