PHPackages                             abdullahhafizh/gif-create - 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. abdullahhafizh/gif-create

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

abdullahhafizh/gif-create
=========================

Easy way to create gif animations from png images.

v1.0.6(1y ago)142MITPHPPHP ~5.6|~7.0|~8.2

Since Nov 25Pushed 1y agoCompare

[ Source](https://github.com/abdullahhafizh/gif-create)[ Packagist](https://packagist.org/packages/abdullahhafizh/gif-create)[ Docs](https://github.com/pomirleanu/gif-create)[ Fund](https://issuehunt.io/r/abdullahhafizh)[ Fund](https://ko-fi.com/abdullahhafizh)[ RSS](/packages/abdullahhafizh-gif-create/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

gif-create
==========

[](#gif-create)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3200854983b91d50ca71702467b99fbd2351f25a87e9889588819104e6eb1688/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706f6d69726c65616e752f6769662d6372656174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pomirleanu/gif-create)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/765cf18e313eb4c668f4291ebee25c574b30e64f3a1b35344986670ca0d36d84/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f706f6d69726c65616e752f6769662d6372656174652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/pomirleanu/gif-create)[![Coverage Status](https://camo.githubusercontent.com/feba2894142b148feeaea2708ba56c215e66ccc8215b2c20423555f35215cd1e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f706f6d69726c65616e752f6769662d6372656174652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pomirleanu/gif-create/code-structure)[![Quality Score](https://camo.githubusercontent.com/d4db5dc83d2fc80d69445ad0379b360bfdbfd240a0225c1f841efa34762e497f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706f6d69726c65616e752f6769662d6372656174652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pomirleanu/gif-create)[![Total Downloads](https://camo.githubusercontent.com/b9c75a21764ac19f4fa07f7956098dc7efe7c162b1a62ee2ef8228316b1e7f4c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706f6d69726c65616e752f6769662d6372656174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pomirleanu/gif-create)

Easy way to create gif animations from png images for laravel 5.\*.

Install
-------

[](#install)

Via Composer

```
$ composer require abdullahhafizh/gif-create
```

### Usage basic php

[](#usage-basic-php)

**1. Inputs:**

```
// Use an array containing file paths, resource vars (initialized with imagecreatefromXXX),
// image URLs or binary image data.
$frames = array(
    imagecreatefrompng("/../images/pic1.png"),      // resource var
    "/../images/pic2.png",                          // image file path
    file_get_contents("/../images/pic3.jpg"),       // image binary data
    "http://thisisafakedomain.com/images/pic4.jpg", // URL
);

// Or: load images from a dir (sorted, skipping .files):
//$frames = "../images";

// Optionally: set different durations (in 1/100s units) for each frame
$durations = array(20, 30, 10, 10);

// Or: you can leave off repeated values from the end:
//$durations = array(20, 30, 10); // use 10 for the rest
// Or: use 'null' anywhere to re-apply the previous delay:
//$durations = array(250, null, null, 500);
```

**2. Create the GIF:**

```
use Pomirleanu\GifCreate;

// ...

$gif = new GifCreate\GifCreate();
$gif->create($frames, $durations);

// Or: using the default 100ms even delay:
//$gif->create($frames);

// Or: loop 5 times, then stop:
//$gif->create($frames, $durations, 5); // default: infinite looping
```

**3. Get/use the result:**

You can now get the animated GIF binary:

```
$gif = $gif->get();
```

...and e.g. send it directly to the browser:

```
header("Content-type: image/gif");
echo $gif;
exit;
```

Or just save it to a file:

```
$gif->save("animated.gif");
```

### Usage in laravel 5.\*

[](#usage-in-laravel-5)

Service provider should be :

```
Pomirleanu\GifCreate\GifCreateServiceProvider::class,
```

Publish needed assets (config file) :

```
php artisan vendor:publish --provider="Pomirleanu\GifCreate\GifCreateServiceProvider"
```

*Note:* Composer won't update them after `composer update`, you'll need to do it manually!

### Behavior

[](#behavior)

- Transparency is based on the first frame. \[!!NOT VERIFIED: "It will be saved only if you give multiple frames with the same transparent background"\]
- The dimensions of the generated GIF are based on the first frame, too. If you need to resize your images to get the same dimensions, you can use this class: .

### Dependencies

[](#dependencies)

- PHP 5.3 (for namespace support &amp; whatnot; noone still shamelessly uses PHP &lt; 5.3, right?!)
- GD (`imagecreatefromstring`, `imagegif`, `imagecolortransparent`)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Pomirleanu Florentin Cristinel](https://github.com/pomirleanu)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance47

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~24 days

Recently: every ~36 days

Total

7

Last Release

390d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79c1c30a16451a86d8cebea23a3354a6c02137682584d13d6953a8ec2bf9f992?d=identicon)[abdullahhafizh](/maintainers/abdullahhafizh)

---

Top Contributors

[![abdullahhafizh](https://avatars.githubusercontent.com/u/19485897?v=4)](https://github.com/abdullahhafizh "abdullahhafizh (7 commits)")[![pomirleanu](https://avatars.githubusercontent.com/u/2902488?v=4)](https://github.com/pomirleanu "pomirleanu (5 commits)")[![qrazi](https://avatars.githubusercontent.com/u/7550540?v=4)](https://github.com/qrazi "qrazi (2 commits)")[![ngfw](https://avatars.githubusercontent.com/u/203863?v=4)](https://github.com/ngfw "ngfw (1 commits)")

---

Tags

pomirleanuGifCreate

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/abdullahhafizh-gif-create/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)

PHPackages © 2026

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