我必须使用 Fred 的 ImageMagick 脚本创建图像的过渡序列,特别是fx 过渡。
在我的 php 代码中,我将所有图像调整为标准尺寸,然后将所有这些图片重命名为 pic000001.jpg、pic000002.jpg、pic000003.jpg 等(我用 $count 进行计数),然后我愿意:
$frameIndex=0;
$frames=18;
//for all the pic000001.jpg, pic000002.jpg, pic000003.jpg.... do a transition
//between them
for($seq=1;$seq<$count;$seq++){
//here I take a picture and the next(IE pic000001 and pic000002)
echo shell_exec("fxtransitions -e swirl -f $frames -d 20 -p 50 $path/pic".str_pad($seq, 6, '0', STR_PAD_LEFT).".jpg $path/pic".str_pad(($seq+1), 6, '0', STR_PAD_LEFT).".jpg $path/fx%06d.jpg");
//here I rename the temporany frames called
//fx000000.jpg to fx000035.jpg for each transition
//to a common index
for($c=0;$c<($frames*2);$c++){
rename("fx".str_pad($c, 6, '0', …Run Code Online (Sandbox Code Playgroud)