PHPackages                             visualweber/gif-frame-extractor - 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. visualweber/gif-frame-extractor

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

visualweber/gif-frame-extractor
===============================

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

047PHP

Since Dec 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/visualweber/gif-frame-extractor)[ Packagist](https://packagist.org/packages/visualweber/gif-frame-extractor)[ RSS](/packages/visualweber-gif-frame-extractor/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#)

GifFrameExtractor
=================

[](#gifframeextractor)

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

[](#-1)

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

### For what ?

[](#for-what-)

The class helps you to separate all the frames of an animated GIF, for example to watermark them and then to generate a new watermarked and animated GIF.

### Usage

[](#usage)

GifFrameExtractor is really easy to use:

**1 - Extraction:**

```
$gifFilePath = 'path/images/picture.gif';

if (GifFrameExtractor::isAnimatedGif($gifFilePath)) { // check this is an animated GIF

    $gfe = new GifFrameExtractor();
    $gfe->extract($gifFilePath);

    // Do something with extracted frames ...
}
```

**2 - Getting the frames and their duration:**

```
foreach ($gfe->getFrames() as $frame) {

    // The frame resource image var
    $img = $frame['image'];

    // The frame duration
    $duration = $frame['duration'];
}
```

You can also get separately an array of images and an array of durations:

```
$frameImages = $gfe->getFrameImages();
$frameDurations = $gfe->getFrameDurations();
```

And obtain usefull informations:

```
$totalDuration = $gfe->getTotalDuration(); // Total duration of the animated GIF
$frameNumber = $gfe->getFrameNumber(); // Number of extracted frames
var_dump($gfe->getFrameDimensions()); // An array containing the dimension of each extracted frame
var_dump($gfe->getFramePositions()); // An array containing the original positions of each extracted frame inside the GIF
```

**Option:**

You can choose if you want to get the original frames (with transparency background) or frames pasted on the first one with the second parameter of extract() method:

```
$gfe->extract('path/images/picture.gif', true); // Can get transparency orignal frames
```

This option is false by default.

### About

[](#about)

The class reuses some part of code of "PHP GIF Animation Resizer" by Taha PAKSU (thanks to him).

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![vswb](https://avatars.githubusercontent.com/u/12278864?v=4)](https://github.com/vswb "vswb (1 commits)")

### Embed Badge

![Health badge](/badges/visualweber-gif-frame-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/visualweber-gif-frame-extractor/health.svg)](https://phpackages.com/packages/visualweber-gif-frame-extractor)
```

###  Alternatives

[lightsaml/symfony-bridge

Light SAML Symfony bridge bundle

292.0M3](/packages/lightsaml-symfony-bridge)[freshbitsweb/laravel-cart-manager

Managing the cart of your Laravel application is a breeze

22622.7k1](/packages/freshbitsweb-laravel-cart-manager)

PHPackages © 2026

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