从ImageMagick的GIF获取第一个转换的PNG文件

问题描述 投票:0回答:1

我正在尝试使用Command将GIF文件转换为PNG文件并调整其大小:

mogrify.exe -define bmp:format=bmp3 -compress none -resize "300x200>" -antialias -format "png" -units PixelsPerInch -density 72 "img.gif"

但是它创建的许多图像的后缀为0到31(img-0.pngimg-31.png)。

[当我使用'-flatten'时,我正在获取合并单个文件,但我只想要第一个转换的文件(img-0.png)。

我们对此有什么选择?

GIF图片:enter image description here

'-flatten'图片:enter image description here

第一张图片:enter image description here

提前感谢!

imagemagick png gif mogrify
1个回答
0
投票

当指定img.gif[0]而不是img.gif时,仅保存第一帧。而且看起来您也不需要-define bmp:format=bmp3,因为您将文件保存到png

© www.soinside.com 2019 - 2024. All rights reserved.