{"id":15551728,"url":"https://github.com/gwaredd/mggif","last_synced_at":"2025-04-14T10:11:09.156Z","repository":{"id":44448163,"uuid":"288825400","full_name":"gwaredd/mgGif","owner":"gwaredd","description":"A unity library to parse GIF files and extract the images as textures","archived":false,"fork":false,"pushed_at":"2023-08-29T11:58:03.000Z","size":9717,"stargazers_count":133,"open_issues_count":1,"forks_count":25,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T23:23:42.329Z","etag":null,"topics":["gif","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gwaredd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-19T20:01:14.000Z","updated_at":"2025-03-05T09:40:40.000Z","dependencies_parsed_at":"2024-01-11T14:13:22.735Z","dependency_job_id":"ff84edcb-c77d-4323-9202-e77e999dffdf","html_url":"https://github.com/gwaredd/mgGif","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwaredd%2FmgGif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwaredd%2FmgGif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwaredd%2FmgGif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwaredd%2FmgGif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gwaredd","download_url":"https://codeload.github.com/gwaredd/mgGif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860217,"owners_count":21173342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gif","unity"],"created_at":"2024-10-02T14:06:50.093Z","updated_at":"2025-04-14T10:11:09.115Z","avatar_url":"https://github.com/gwaredd.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mgGIF\n\u003e A unity library to parse a GIF file and extracts the images, just for fun\n\n![Butterfly](https://gwaredd.github.io/mgGif/butterfly.gif)\n\n## Installation\n\nCopy [Assets\\mgGif\\mgGif.cs](https://github.com/gwaredd/mgGif/blob/master/Assets/mgGif/mgGif.cs) to your project.\n\nAlternatively, the [upm](https://github.com/gwaredd/mgGif/tree/upm) branch can be pulled directly into the `Packages` directory, e.g.\n\n```\ngit clone -b upm git@github.com:gwaredd/mgGif.git\n```\n\n## Usage\n\nPass a `byte[]` of the GIF file and loop through results.\n\n```cs\n\nbyte[] data = File.ReadAllBytes( \"some.gif\" );\n\nusing( var decoder = new MG.GIF.Decoder( data ) )\n{\n    var img = decoder.NextImage();\n\n    while( img != null )\n    {\n        Texture2D tex = img.CreateTexture();\n        int delay = img.Delay;\n        \n        img = decoder.NextImage();\n    }\n}\n```\n\nSee [AnimatedTextures.cs](https://github.com/gwaredd/mgGif/blob/main/Assets/Scenes/Scripts/AnimatedTextures.cs) for an example\n\n**NB:** For speed the decoder will reuse buffers between each `NextImage()` call. If you need to keep the raw image data then ensure you `Clone()` it first.\n\nFor an additional performance improvement, uncomment `mgGIF_UNSAFE` at the top of the file and allow unsafe code compilation in the assembly.\n\n## Benchmarks\n\nBenchmarks of the time to decode three test animations using different libraries.\n\n| Library               | Editor    | Mono      | IL2CPP    |\n|-----------------------|-----------|----------|------------|\n| UniGif                | 7321 ms   | 3790 ms  | 3178 ms    |\n| Unity-GifDecoder      | 365  ms   | 123  ms  | 88   ms    |\n| mgGif                 | 247  ms   | 112  ms  | 80   ms    |\n| mgGif (Unsafe Mode)   | 280  ms   | 106  ms  | 70   ms    |\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwaredd%2Fmggif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgwaredd%2Fmggif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwaredd%2Fmggif/lists"}