PHPackages                             ambrightgrove/gif-creator - 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. [Image &amp; Media](/categories/media)
4. /
5. ambrightgrove/gif-creator

ActiveLibrary[Image &amp; Media](/categories/media)

ambrightgrove/gif-creator
=========================

PHP class that creates animated GIF from multiple images

v1.0.0(4y ago)047MITPHPPHP &gt;=5.3.0

Since Apr 15Pushed 4y agoCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

================================
================================

[](#)

GifCreator
==========

[](#gifcreator)

================================
================================

[](#-1)

GifCreator is a PHP class to create animated GIF from multiple images

### For what ?

[](#for-what-)

This class helps you to create an animated GIF image: give multiple images and their duration and that's it !

### Usage

[](#usage)

**1 - Creation:**

```
// Create an array containing file paths, resource var (initialized with imagecreatefromXXX),
// image URLs or even binary code from image files.
// All sorted in order to appear.
$frames = array(
    imagecreatefrompng("/../images/pic1.png"), // Resource var
    "/../images/pic2.png", // Image file path
    file_get_contents("/../images/pic3.jpg"), // Binary source code
    'http://thisisafakedomain.com/images/pic4.jpg', // URL
);

// Create an array containing the duration (in millisecond) of each frames (in order too)
$durations = array(40, 80, 40, 20);

// Initialize and create the GIF !
$gc = new GifCreator();
$gc->create($frames, $durations, 5);
```

The 3rd parameter of create() method allows you to choose the number of loop of your animated gif before it stops. In the previous example, I chose 5 loops. Set 0 (zero) to get an infinite loop.

**2 - Get the result:**

You can now get the animated GIF binary:

```
$gifBinary = $gc->getGif();
```

Then you can show it in the navigator:

```
header('Content-type: image/gif');
header('Content-Disposition: filename="butterfly.gif"');
echo $gifBinary;
exit;
```

Or save it in a folder as a GIF:

```
file_put_contents('/myfolder/animated_picture.gif', $gifBinary);
```

### Behavior

[](#behavior)

- The transparency is based on the first given frame. It will be saved only if you give multiple frames with same transparent background.
- The dimensions of the generated GIF are based on the first frame. If you need to resize your frames to get the same dimension, you can use this class:

### About

[](#about)

The class reuses some part of code of "GIFEncoder.class.php" by László Zsidi (thanks to him).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a6fc6c692277d43d82437ff905c9fc2013c7a83c0125e3ef38cf0e850a7e45b?d=identicon)[ambrightgrove](/maintainers/ambrightgrove)

---

Top Contributors

[![Sybio](https://avatars.githubusercontent.com/u/1507731?v=4)](https://github.com/Sybio "Sybio (17 commits)")[![ambrightgrove](https://avatars.githubusercontent.com/u/95235436?v=4)](https://github.com/ambrightgrove "ambrightgrove (5 commits)")

### Embed Badge

![Health badge](/badges/ambrightgrove-gif-creator/health.svg)

```
[![Health](https://phpackages.com/badges/ambrightgrove-gif-creator/health.svg)](https://phpackages.com/packages/ambrightgrove-gif-creator)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
