meatball1982 发表于 2020-3-24 14:26:48

豆粑粑 convert png to gif

本帖最后由 meatball1982 于 2020-3-24 18:46 编辑

I have 10 png file, named as    a00.png a01.png a02.png ....a09.png



you need the "ImageMagick" first
Mac install
brew install ImageMagick



mogrify -resize 600x350 *.png
convert -delay 100 *.png -loop 0 out.gif

mogrifyis used for resize the png file.
convert is used for combine the png file.


some times , you have a00.png, b00.png a01.png b01.png ,... a09.png, b09.png
you want to combine a00.png b00.png into c00.png.
then generate the all_c.gif

for((i=0;i<=9;i++))
do
      montage -geometry 500 a0$i.png b0$i.png c0$i.png
done



meatball1982 发表于 2023-9-17 09:35:20

现在,有gdp.gif 和gtp.gif
想平着摆(side by side)
思路是,各自分成单frame的图像,并排放,然后再合在一起。

convert gdp.gif -coalesce a-%04d.gif                         # separate frames of 1.gif
convert gtp.gif -coalesce b-%04d.gif                         # separate frames of 2.gif
for(( i=0; i<10; i++))
do
        echo $i
        convert a-000$i.gif b-000${i}.gif +append c-000${i}.gif
done

convert -loop 0 -delay 40 c-*.gif result40.gif


页: [1]
查看完整版本: 豆粑粑 convert png to gif