Imagemagick convert command: set delay time for the last frame

前端 未结 1 2017
青春惊慌失措
青春惊慌失措 2021-02-13 04:25

I have some .png files named \'_tmp*.png\' and I want to convert them into a gif file by the convert command with imagemagick. So i could use

convert -delay 20          


        
1条回答
  •  滥情空心
    2021-02-13 05:13

    You can do it like this:

    convert -delay 40 {1..9}.png -delay 300 10.png -delay 40 {11..14}.png animated.gif 
    

    Basically, you set the delay just before the image you want it to affect and it stays set until you change it.

    If you want to set a variable delay, so that the first (i.e. black here) and the last frame (i.e. yellow here) are displayed longer, you can do this:

    convert -size 300x200 xc:black xc:red xc:lime xc:blue xc:cyan xc:magenta xc:yellow -set delay '%[fx:t==(n-1) || t==0 ? 400 : 40]' result.gif
    

    0 讨论(0)
提交回复
热议问题