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

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

batrox/gif-frame-extractor
==========================

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

v1.0(2y ago)032MITPHPPHP &gt;=5.3.0

Since Apr 23Pushed 2y agoCompare

[ Source](https://github.com/batrox/GifFrameExtractor)[ Packagist](https://packagist.org/packages/batrox/gif-frame-extractor)[ Docs](https://github.com/Sybio/GifFrameExtractor)[ RSS](/packages/batrox-gif-frame-extractor/feed)WikiDiscussions master Synced 1mo ago

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

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

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

753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/600ddb056d99d542b6cecb23d556a00117b3f9156d1f1f3fd239aaa4df5e5ce7?d=identicon)[batrox](/maintainers/batrox)

---

Top Contributors

[![Sybio](https://avatars.githubusercontent.com/u/1507731?v=4)](https://github.com/Sybio "Sybio (18 commits)")[![batrox](https://avatars.githubusercontent.com/u/7557661?v=4)](https://github.com/batrox "batrox (2 commits)")

---

Tags

phptimegifdurationanimatedseparateframe

### Embed Badge

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

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

###  Alternatives

[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)[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6308.9M39](/packages/knplabs-knp-time-bundle)[khill/php-duration

Converts between colon formatted time, human-readable time and seconds

1611.7M20](/packages/khill-php-duration)[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14282.3k](/packages/dater-dater)[zjkal/time-helper

一个简单快捷的PHP日期时间助手类库。 a smart PHP datetime helper library.

21128.6k1](/packages/zjkal-time-helper)[maherelgamil/arabicdatetime

Easy and useful tool to generate arabic or hijri date with multi-language support for laravel

414.5k](/packages/maherelgamil-arabicdatetime)

PHPackages © 2026

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