Modify an animated Gif so that it's frames are played at a variable speed, varying between being shown for 50milliseconds down to 0ms, which will cause the frame to be skipped in most browsers.
Image
Modify an animated Gif so that it's frames are played at a variable speed, varying between being shown for 50milliseconds down to 0ms, which will cause the frame to be skipped in most browsers.
function setImageDelay()
{
    $imagick = new \Imagick(realpath("images/coolGif.gif"));

    $frameCount = 0;

    foreach ($imagick as $frame) {
        /** @var $frame \Imagick */
        $frame->setImageDelay((($frameCount % 11) * 5));
        $frameCount++;
    }

    $imagick2 = $imagick->deconstructImages();

    header("Content-Type: image/gif");
    echo $imagick2->getImagesBlob();
}