PHPackages                             rubin/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. rubin/gif-creator

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

rubin/gif-creator
=================

PHP class that creates animated GIF from multiple images

1.1.0(8y ago)0231MITPHPPHP &gt;=5.3.0

Since Oct 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/xRubin/GifCreator)[ Packagist](https://packagist.org/packages/rubin/gif-creator)[ RSS](/packages/rubin-gif-creator/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (3)Used By (1)

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

[](#)

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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% 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

Every ~1872 days

Total

2

Last Release

3089d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3bbe4824398b494256466d4887e688c0d102afa2fc966cfd418124159607903?d=identicon)[xRubin](/maintainers/xRubin)

---

Top Contributors

[![Sybio](https://avatars.githubusercontent.com/u/1507731?v=4)](https://github.com/Sybio "Sybio (17 commits)")[![xRubin](https://avatars.githubusercontent.com/u/9638619?v=4)](https://github.com/xRubin "xRubin (2 commits)")

---

Tags

phpencodegifanimatedcreation

### Embed Badge

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

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

###  Alternatives

[lunakid/anim-gif

PHP class to create an animated GIF from multiple images

90136.3k1](/packages/lunakid-anim-gif)[sybio/gif-creator

PHP class that creates animated GIF from multiple images

326395.7k14](/packages/sybio-gif-creator)[sybio/gif-frame-extractor

PHP class that separates all the frames (and their duration) of an animated GIF

179417.2k8](/packages/sybio-gif-frame-extractor)[dereuromark/media-embed

A PHP library to deal with all those media services around, parsing their URLs and embedding their audio/video content in websites.

182530.3k11](/packages/dereuromark-media-embed)

PHPackages © 2026

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