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

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

moroz1999/gif-creator
=====================

PHP class that creates animated GIF from multiple images

1.2.0(4y ago)21201MITPHPPHP ^8.0

Since Oct 13Pushed 4y ago2 watchersCompare

[ Source](https://github.com/moroz1999/GifCreator)[ Packagist](https://packagist.org/packages/moroz1999/gif-creator)[ Docs](https://github.com/Sybio/GifCreator)[ RSS](/packages/moroz1999-gif-creator/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (6)Used By (1)

> \*NOTE: This is a fork of [Clément Guillemain](https://github.com/Sybio)'s nice [GifCreator class](https://github.com/Sybio/GifCreator), with some minor bug fixes and most pull requests merged together.

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

[](#)

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 centiseconds (hundredths of a second)) of each frames (in order too)
$durations = array(40, 80, 40, 20);

// Initialize and create the GIF !
$gc = new GifCreator\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

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 53.1% 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 ~815 days

Total

5

Last Release

1697d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

1.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/474050da31530d4af16eca69a75ab9452dbd6d452262be4c4fa1ec8f03975259?d=identicon)[moroz1999](/maintainers/moroz1999)

---

Top Contributors

[![Sybio](https://avatars.githubusercontent.com/u/1507731?v=4)](https://github.com/Sybio "Sybio (17 commits)")[![moroz1999](https://avatars.githubusercontent.com/u/11526203?v=4)](https://github.com/moroz1999 "moroz1999 (6 commits)")[![robho](https://avatars.githubusercontent.com/u/4707486?v=4)](https://github.com/robho "robho (5 commits)")[![bosz](https://avatars.githubusercontent.com/u/6331902?v=4)](https://github.com/bosz "bosz (2 commits)")[![jambonbill](https://avatars.githubusercontent.com/u/3353004?v=4)](https://github.com/jambonbill "jambonbill (2 commits)")

---

Tags

phpencodegifanimatedcreation

### Embed Badge

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

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