PNG + GIF combine questions
Posted: 2014-03-19T03:30:21-07:00
Hello!
I am developing a service that will combine static images with animated pictures. In howling script I use the following PHP algorithm:
Then get on the file using AJAX.
Picture generated about 30 seconds, which in itself - quite a lot.
1. Are there ways to increase the speed s software image generation?
2. Is it possible to combine with a translucent gradient PNG and GIF, while maintaining transparency gradient? How do previous frames without layering on each other?
I am developing a service that will combine static images with animated pictures. In howling script I use the following PHP algorithm:
Code: Select all
$animation = new Imagick();
$animation->setFormat("GIF");
$gif = new Imagick('img/gif/anim.gif');
$gif = $gif->coalesceImages();
foreach ($gif as $frame) {
$canvas -> compositeImage($frame , imagick::COMPOSITE_DEFAULT , 0,0);
$animation->addImage($canvas);
$animation->nextImage();
}
$animation->writeImages('gallery/gif/'.$fileName.'.gif', true);
echo "/gallery/gif/".$fileName.".gif";
Picture generated about 30 seconds, which in itself - quite a lot.
1. Are there ways to increase the speed s software image generation?
2. Is it possible to combine with a translucent gradient PNG and GIF, while maintaining transparency gradient? How do previous frames without layering on each other?