如果提取到GIF,而不是PNG,它似乎很動聽:
convert animated.gif frame%d.gif
identify frame*
frame0.gif GIF 307x465 307x465+0+0 8-bit sRGB 256c 61.8KB 0.000u 0:00.000
frame1.gif[1] GIF 278x372 307x465+16+61 8-bit sRGB 256c 19.9KB 0.000u 0:00.000
frame10.gif[2] GIF 278x371 307x465+17+62 8-bit sRGB 256c 17.9KB 0.000u 0:00.000
frame11.gif[3] GIF 278x370 307x465+17+63 8-bit sRGB 256c 17.4KB 0.000u 0:00.000
frame12.gif[4] GIF 275x371 307x465+20+62 8-bit sRGB 256c 17.2KB 0.000u 0:00.000
frame13.gif[5] GIF 276x370 307x465+19+63 8-bit sRGB 256c 17.9KB 0.000u 0:00.000
frame14.gif[6] GIF 275x369 307x465+19+64 8-bit sRGB 256c 16.8KB 0.000u 0:00.000
如果要覆蓋這些在一張空白的畫布,你可以做這樣的事情。我沒有想過太多,有可能是一個更簡單的方法,但現在......
#!/bin/bash
# Extract individual frames
convert animated.gif frame%d.gif
# Make a blank canvas same size as original
convert -size 307x465 xc:none canvas.gif
i=0
for f in frame*; do
geom=$(identify -format "%X%Y" $f)
convert canvas.gif $f -geometry $geom -composite +repage g_$i.gif
((i++))
done
或者,也許你的意思是你想在自己的正確的相對位置的所有幀,但一前一後在單個文件中的長序列?
#!/bin/bash
# Extract individual frames
convert animated.gif frame%d.gif
# Make a blank canvas same size as original
convert -size 307x465 xc:none canvas.gif
# Paste individual frames onto blank canvas and append frames into long sequence
for f in frame*; do
geom=$(identify -format "%X%Y" $f)
convert canvas.gif $f -geometry $geom -composite +repage miff:-
done | convert - +append sequence.gif
如何張貼GIF動畫? – 2015-04-05 08:51:20
當然,更新... – 2015-04-05 08:56:13