PHPackages                             stil/gif-endec - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stil/gif-endec

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

stil/gif-endec
==============

PHP GIF decoder and decoder with callback functions.

v0.2.0(9y ago)6318.4k↓38.5%16[5 issues](https://github.com/stil/gif-endec/issues)[1 PRs](https://github.com/stil/gif-endec/pulls)MITPHPPHP &gt;=5.4

Since Feb 23Pushed 5y ago8 watchersCompare

[ Source](https://github.com/stil/gif-endec)[ Packagist](https://packagist.org/packages/stil/gif-endec)[ RSS](/packages/stil-gif-endec/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Introduction
------------

[](#introduction)

### What is that?

[](#what-is-that)

gif-endec is a GIF encoder and decoder. It allows you to split animated GIFs into separate frames. You can also extract frame durations and disposal method (disposal method indicates the way in which the graphic is to be treated after being displayed).

### Performance

[](#performance)

Thanks to some code optimizations, this library decodes animated GIFs much faster than [Sybio/GifFrameExtractor](https://github.com/Sybio/GifFrameExtractor). It also optimizes memory usage, allowing you to process decoded frames one after another. It doesn't load all frames to memory at once.

### Installation

[](#installation)

Install this package with Composer.

```
composer require stil/gif-endec
```

Split animated GIF into frames
------------------------------

[](#split-animated-gif-into-frames)

In this example we'll split this animated GIF into separate frames. [![](https://camo.githubusercontent.com/d0a1ee1da1cc3a490c3f3bf6efbf7a28cae82c3bdd24957b7cc9efae0b8fb9b0/68747470733a2f2f692e696d6775722e636f6d2f5157464a5152322e676966)](https://camo.githubusercontent.com/d0a1ee1da1cc3a490c3f3bf6efbf7a28cae82c3bdd24957b7cc9efae0b8fb9b0/68747470733a2f2f692e696d6775722e636f6d2f5157464a5152322e676966)

```
