{"id":20128943,"url":"https://github.com/intervention/gif","last_synced_at":"2026-04-01T21:13:19.334Z","repository":{"id":44675166,"uuid":"42121254","full_name":"Intervention/gif","owner":"Intervention","description":"Native PHP GIF Encoder/Decoder","archived":false,"fork":false,"pushed_at":"2025-03-31T14:08:56.000Z","size":264,"stargazers_count":46,"open_issues_count":2,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T07:36:32.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Intervention.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Intervention"],"ko_fi":"interventionphp","custom":"https://paypal.me/interventionio"}},"created_at":"2015-09-08T15:26:02.000Z","updated_at":"2025-03-31T14:08:59.000Z","dependencies_parsed_at":"2022-08-21T12:50:56.342Z","dependency_job_id":"880f2711-4995-4d06-897a-ded09bd27238","html_url":"https://github.com/Intervention/gif","commit_stats":{"total_commits":81,"total_committers":2,"mean_commits":40.5,"dds":"0.012345679012345734","last_synced_commit":"7d893db9f7444fbb82ba3bc75807ab0cea28750f"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fgif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fgif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fgif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intervention%2Fgif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intervention","download_url":"https://codeload.github.com/Intervention/gif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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":[],"created_at":"2024-11-13T20:30:43.018Z","updated_at":"2026-04-01T21:13:19.284Z","avatar_url":"https://github.com/Intervention.png","language":"PHP","funding_links":["https://github.com/sponsors/Intervention","https://ko-fi.com/interventionphp","https://paypal.me/interventionio"],"categories":[],"sub_categories":[],"readme":"# Intervention GIF\n## Native PHP GIF Encoder/Decoder\n\n[![Latest Version](https://img.shields.io/packagist/v/intervention/gif.svg)](https://packagist.org/packages/intervention/gif)\n![build](https://github.com/Intervention/gif/actions/workflows/build.yml/badge.svg)\n[![Monthly Downloads](https://img.shields.io/packagist/dm/intervention/gif.svg)](https://packagist.org/packages/intervention/gif/stats)\n[![Support me on Ko-fi](https://raw.githubusercontent.com/Intervention/gif/main/.github/images/support.svg)](https://ko-fi.com/interventionphp)\n\nIntervention GIF is a PHP encoder and decoder for the GIF image format that\ndoes not depend on any image processing extension.\n\nOnly the special `Splitter::class` class divides the data stream of an animated\nGIF into individual `GDImage` objects for each frame and is therefore dependent\non the GD library.\n\nThe library is the main component of [Intervention\nImage](https://github.com/Intervention/image) for processing animated GIF files\nwith the GD library, but also works independently.\n\n## Installation\n\nYou can easily install this package using [Composer](https://getcomposer.org).\nJust request the package with the following command:\n\n```bash\ncomposer require intervention/gif\n```\n\n## Code Examples\n\n### Decoding\n\n```php\nuse Intervention\\Gif\\Decoder;\n\n// Decode filepath to Intervention\\Gif\\GifDataStream::class\n$gif = Decoder::decode('images/animation.gif');\n\n// Decoder can also handle binary content directly\n$gif = Decoder::decode($contents);\n```\n\n### Encoding\n\nUse the Builder class to create a new GIF image.\n\n```php\nuse Intervention\\Gif\\Builder;\n\n// create new gif canvas\n$gif = Builder::canvas(width: 32, height: 32);\n\n// add animation frames to canvas\n$delay = .25; // delay in seconds after next frame is displayed\n$left = 0; // position offset (left)\n$top = 0; // position offset (top)\n\n// add animation frames with optional delay in seconds\n// and optional position offset for each frame\n$gif-\u003eaddFrame('images/frame01.gif', $delay, $left, $top);\n$gif-\u003eaddFrame('images/frame02.gif', $delay, $left);\n$gif-\u003eaddFrame('images/frame03.gif', $delay);\n$gif-\u003eaddFrame('images/frame04.gif');\n\n// set loop count; 0 for infinite looping\n$gif-\u003esetLoops(12);\n\n// encode\n$data = $gif-\u003eencode();\n```\n\n\n## Requirements\n\n- PHP \u003e= 8.1\n\n## Development \u0026 Testing\n\nWith this package comes a Docker image to build a test suite and analysis\ncontainer. To build this container you have to have Docker installed on your\nsystem. You can run all tests with this command.\n\n```bash\ndocker-compose run --rm --build tests\n```\n\nRun the static analyzer on the code base.\n\n```bash\ndocker-compose run --rm --build analysis\n```\n\n## Authors\n\nThis library is developed and maintained by [Oliver Vogel](https://intervention.io)\n\nThanks to the community of [contributors](https://github.com/Intervention/gif/graphs/contributors) who have helped to improve this project.\n\n## License\n\nIntervention GIF is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintervention%2Fgif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintervention%2Fgif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintervention%2Fgif/lists"}