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

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

vendi-advertising/gif-creator
=============================

PHP class that creates animated GIF from multiple images

1.1.0(2y ago)08MITPHPPHP &gt;=8.1.0

Since Feb 29Pushed 2y agoCompare

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

READMEChangelog (1)DependenciesVersions (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

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

803d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7748460?v=4)[Chris Haas](/maintainers/cjhaas)[@cjhaas](https://github.com/cjhaas)

---

Top Contributors

[![Sybio](https://avatars.githubusercontent.com/u/1507731?v=4)](https://github.com/Sybio "Sybio (17 commits)")[![cjhaas](https://avatars.githubusercontent.com/u/7748460?v=4)](https://github.com/cjhaas "cjhaas (3 commits)")[![faizanakram99](https://avatars.githubusercontent.com/u/10880992?v=4)](https://github.com/faizanakram99 "faizanakram99 (2 commits)")

---

Tags

phpencodegifanimatedcreation

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/vendi-advertising-gif-creator/health.svg)](https://phpackages.com/packages/vendi-advertising-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)
