简体   繁体   English

ImageMagick - Windows和转换功能问题

[英]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/ 我正在尝试使用imagemagick从几个png文件创建一个简单的.gif文件,使用此处概述的一般方法: 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 但是,我在Windows 10机器上,我认为这会导致转换功能出现问题,如下所述: 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? 有人可以解释我如何更改imagemagick或Windows以便它可以工作?

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. 您可能已在计算机上安装了ImageMagick 7.X. This version no longer includes convert.exe and the error that you are receiving is from the convert command of Windows. 此版本不再包含convert.exe ,您收到的错误来自Windows的convert命令。 You can use magick.exe instead or select Install legacy utilities (eg convert) during the installation to install convert.exe on your machine.. 您可以改为使用magick.exe或在安装过程中选择Install legacy utilities (eg convert)以在您的机器上安装convert.exe

而不是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. 在我的Windows 10上使用版本:ImageMagick 7.0.3-4 Q8 x64 2016-10-10,在'convert'前面添加'magick'可以摆脱'invalid parameter'错误。 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: 例如, magick convert foo.jpg -quality 60 low_foo.jpg如果更喜欢定义文件中的步骤:将以下文件保存为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. 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并在bash上运行sh convert.sh foo命令提示符以四种不同的方式处理foo.jpg。 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. 值得一提的是,在安装之后,“C:\\ Program Files \\ ImageMagick-7.0.3-Q8”首先出现在系统/高级系统设置/系统变量/路径的列表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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