Domanda

Sto usando ImageMagick per ridimensionare i file caricato ma mentre stanno elaborando Voglio mostrare una ruota gif rotante all'utente in cui la miniatura sarà normalmente.Servito circa 7 dimensioni di pollici e vorrei che la ruota rimanga alla sua dimensione 32x32 nel mezzo, questo è il bit semplice.

Quello che devo sapere è, posso fare quanto sopra pur mantenendo ancora l'animazione

Esempio:

Immagine: questa immagine

A partire da questa dimensione questa taglia

con animazione

È stato utile?

Soluzione

C'è una soluzione in Php Witch I Uso per filigrana immagini animate GIF .... Crea un bacground nero ha messo un'immagine su di esso e quindi metti la filigrana ...

watermarkpath = 'path to wathermarkimage.jpg|gif|png';
$imagepath= 'path to the image';     
$watermark = new Imagick($watermarkpath);
 $GIF = new Imagick();
 $GIF->setFormat("gif");

$animation = new Imagick($imagepath);
foreach ($animation as $frame) {

    $iWidth = $frame->getImageWidth();
    $iHeight = $frame->getImageHeight();
    $wWidth = $watermark->getImageWidth();
    $wHeight = $watermark->getImageHeight();

    if ($iHeight < $wHeight || $iWidth < $wWidth) {
        // resize the watermark
        $watermark->scaleImage($iWidth, $iHeight);

        // get new size
        $wWidth = $watermark->getImageWidth();
        $wHeight = $watermark->getImageHeight();
    }

    $bgframe = new Imagick();
    $bgframe->newImage(($iWidth), ($iHeight + 80), new ImagickPixel('Black'));
    $bgframe->setImageDelay($frame->getImageDelay());


    $x = ($iWidth) - $wWidth - 5;
    $y = ($iHeight + 80) - $wHeight - 5;


    $bgframe->compositeImage($frame, imagick::COMPOSITE_DEFAULT, 0, 0);
     $bgframe->flattenImages();
    $bgframe->compositeImage($watermark, imagick::COMPOSITE_OVER, $x, $y);
     $bgframe->flattenImages();
    $GIF->addImage($bgframe);
}



$GIF->writeimages($imagepath,true);
.

Altri suggerimenti

Dai un'occhiata a questo violino, potrebbe contenere ciò che desideri: http://jsfiddle.net/tgdfb/1/

Usa jquery, ma dovrebbe essere facilmente adattabile ...

finì per farlo manualmente da Photoshop dopo non essere in grado di trovare un modo automatico di farlo attraverso ImageMagick.Ho trovato la bandiera 'Coalesce' ma non molto altro.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top