Animated GIF

Grafika can resize animated GIFs either on GD or Imagick, preserving their animation in the process.

Input:

Code:

use Grafika\Grafika;

$editor = Grafika::createEditor();
$editor->open( $image, 'animated.gif' );
$editor->resizeFit( $image, 600, 310 );
$editor->save( $image, 'output.gif' );

Output:

Flattening Animated Images

Flattening an animated GIF will remove its animation and convert to just a regular GIF.

Code:

use Grafika\Grafika;

$editor = Grafika::createEditor();
$editor->open( $image, 'animated.gif' );
$editor->flatten( $image );
$editor->save( $image, 'output.gif' );

Output:

Note: For now, support on animated GIF is limited to resize operations. Other operations such as applying filters or text will do nothing.