Imagemagick & Pillow generate malformed GIF frames

前端 未结 3 1259
[愿得一人]
[愿得一人] 2021-01-23 01:16

I need to extract the middle frame of a gif animation.

Imagemagick:

convert C:\\temp\\orig.gif -coalesce C:\\temp\\frame.jpg

generates

3条回答
  •  爱一瞬间的悲伤
    2021-01-23 01:36

    You are attempting to coalesce a single input image into single output image. What you got is what you asked for.

    Instead you should "flatten" frames 0-4 into a single output image:

    convert C:\temp\orig.gif[0-4] -flatten C:\temp\frame.jpg
    

    If you use "-coalesce" you'll get 5 frames of output in frame-0.jpg through frame-4.jpg, the last of them being the image you wanted.

提交回复
热议问题