Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract frames of an animated GIF with PHP

I search for a long time how to extract frames from an animated GIF with PHP... unfortunaly I just found how to get their duration...

I really need to extract the GIF frames and their duration to apply some resize, rotate, etc, on each and then to regenerate the GIF with edited frames !

I don't want to use any software, external library (like ImageMagick), just PHP: in fact I need to allow my class http://phpimageworkshop.com/ to work with animated GIF.

If you have any idea, I'm listening you ^^ !

like image 459
Sybio Avatar asked Sep 23 '12 10:09

Sybio


People also ask

How do I extract a frame from a GIF?

Go to the GIFGIFS GIF splitter page. Click on Upload GIF or on Paste Image URL. After the GIF is uploaded, its size and dimensions become visible. Now, click on Extract Frames.

Can you get a GIF as a widget?

Make your precious home screen fun and unique by decorating it with your favorite animated gifs! The animation will continuously play inside a widget right on your home screen. This free version lets you use one gif in as many widgets as you like. Check out the pro version for unlimited gifs!

How do I extract a GIF from a frame in gimp?

GIMP opens a new window, called Export Layers. In here, browse to the location where you want the frames from your animated GIF to be saved, select the file extension you want to use for the frames and, finally, click or tap Export.


1 Answers

I spent my day creating a class based on this one to achieve what I wanted using only PHP!

You can find it here: https://github.com/Sybio/GifFrameExtractor

Thanks for your answers!

like image 200
Sybio Avatar answered Oct 23 '22 21:10

Sybio