简体   繁体   中英

ImageMagick - Issue with Windows and convert function

I'm trying to use imagemagick to create a simple .gif file from a few png files, using the general approach outlined here: http://www.r-bloggers.com/animated-plots-with-r/

However, I'm on a Windows 10 machine, and I think that's causing problems with the convert function as generally described here: http://www.imagemagick.org/discourse-server/viewtopic.php?t=19679

Can someone please explain how I can either change imagemagick or Windows so that it works?

Specifically the command I'm giving and the error that occurs is shown below:

convert *.png new.gif

The error:

Invalid Parameter - the.gif

Thank you for your help.

You probably installed ImageMagick 7.X on your machine. This version no longer includes convert.exe and the error that you are receiving is from the convert command of Windows. You can use magick.exe instead or select Install legacy utilities (eg convert) during the installation to install convert.exe on your machine..

而不是convert.exe <args> ,请使用magick.exe convert <args>

With Version: ImageMagick 7.0.3-4 Q8 x64 2016-10-10 on my Windows 10, adding 'magick' in front of 'convert' gets rid of the 'invalid parameter' error. For example, magick convert foo.jpg -quality 60 low_foo.jpg If preferring to define the steps in a file: save the following file as convert.sh:
SRC="$1" LOW=60 magick convert $SRC.jpg -quality $LOW low_$SRC.jpg magick convert $SRC.jpg -quality $LOW low_$SRC.webp magick convert $SRC.jpg -quality $LOW -resize 50% "$SRC"_"$LOW"q_50pc.jpg magick convert $SRC.jpg -quality $LOW -resize 50% "$SRC"_"$LOW"q_50pc.webp and running sh convert.sh foo at a bash command prompt processes foo.jpg in four different ways. It bears to mention that after the installment, 'C:\\Program Files\\ImageMagick-7.0.3-Q8' appears first on the list at the System/Advanced System Setting/System Variable/Path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM