如果您得到Abort
or Segmentation Faults
,则表明您的 ImageMagick 的编译/构建/链接不匹配。
我建议您删除已安装的所有 ImageMagick,然后重新开始,homebrew
这是在 OSX 上安装 ImageMagick 的最简单方法。基本上,您可以访问Homebrew 网站并将单行程序复制并粘贴到终端中以进行安装(我不想在此处显示该行,以防将来发生更改而过时)。
安装自制软件后,只需:
brew install imagemagick
如果您想查看支持 X11、TIFF、fftw 等的选项,只需运行:
brew options imagemagick
输出
--with-fftw
Compile with FFTW support
--with-fontconfig
Build with fontconfig support
--with-ghostscript
Build with ghostscript support
--with-hdri
Compile with HDRI support
--with-jp2
Compile with Jpeg2000 support
--with-liblqr
Build with liblqr support
--with-librsvg
Build with librsvg support
--with-libwmf
Build with libwmf support
--with-little-cms
Build with little-cms support
--with-little-cms2
Build with little-cms2 support
--with-openexr
Build with openexr support
--with-openmp
Compile with OpenMP support
--with-pango
Build with pango support
--with-perl
enable build/install of PerlMagick
--with-quantum-depth-16
Compile with a quantum depth of 16 bit
--with-quantum-depth-32
Compile with a quantum depth of 32 bit
--with-quantum-depth-8
Compile with a quantum depth of 8 bit
--with-webp
Build with webp support
--with-x11
Build with x11 support
--without-freetype
Build without freetype support
--without-jpeg
Build without jpeg support
--without-libpng
Build without libpng support
--without-libtiff
Build without libtiff support
--without-magick-plus-plus
disable build/install of Magick++
--without-opencl
Disable OpenCL
--HEAD
Install HEAD version
然后你可以这样做:
brew install imagemagick --with-hdri --with-librsvg
或者,如果您已经安装了 ImageMagick,您可以使用以下命令更改已安装的选项:
brew reinstall imagemagick --with-x11 ...
正如 Glenn 在评论中指出的那样,比您使用的命令更简单的命令可能是:
convert old_icon_16x16.png png32:icon_16x16.png
另外,请注意convert
从magick
第 7 版开始 - 尽管homebrew
目前仍在提供第 6 版。