I try to adding text on animated gif with ImageMagick :
$source = public_path().'/test.gif';
$output = public_path().'/test2.gif';
$text = 'the cake is a lie';
// Create objects
$image = new Imagick($source);
// Create a new drawing palette
$draw = new ImagickDraw();
// Set font properties
$draw->setFont(public_path().'/fonts/Impact.ttf');
$draw->setFontSize(20);
$draw->setFillColor('black');
// Position text at the bottom-right of the image
$draw->setGravity(Imagick::GRAVITY_SOUTHEAST);
// Draw text on the image
$image->annotateImage($draw, 10, 12, 0, $text);
// Draw text again slightly offset with a different color
$draw->setFillColor('white');
$image->annotateImage($draw, 11, 11, 0, $text);
// Set output image format
$image->setImageFormat('gif');
$image->writeImage($output);
But with this code the image is no longer animated and the quality is very bad, any idea ?