Image Processing tool-kit
Stack Overflow: questions tagged ‘ImageMagick’
Supported image formats




install from


Make sure it’s early-enough in your PATH environment variable, as there is windows cmd CONVERT -- one will have to clobber the other.


If the environment variable stops working (it was fine one minute, stopped the next) you’ll get errors like “Invalid Parameter - -monochrome”.  I ended up specifying the full path to the convert.exe file until I can get it working again.



weird errors

Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module Image::Magick: load_file:
This application has failed to start because the application configuration is incorrect.
Reinstalling the application may fix this problem at C:/Perl/lib/ line 201. at C:\Program Files\ line 18
Compilation failed in require at C:\Program Files\ line 18.
BEGIN failed--compilation aborted at C:\Program Files\ line 18.


Solution: installed the Microsoft Visual C++ 2008 Redistributable:


If you have trouble installing try installing this first: vcredist_x86.ZIP Δ (also available from the IM installation page)



Perl components

If you want to use the PerlMagick component, make sure that Perl is installed first.


Also, check the appropriate boxes:


post-install, you should see folders like c:\perl\site\lib\Image and c:\perl\site\lib\auto\Image\Magick\



Ghostscript for PDFs

If you’re going to convert PDFs, you need to have GhostScript installed, as well.


convert -density 200 -compress lzw -type bilevel \path\to\ForConversion\TempConversion\temp.pdf temp.tif
convert: `%s': %s "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r200x200"  "-sOutputFile=C:/DOCUME~1/MICHAE~1/LOCALS~1/Temp/magick-_9nmWZZK" "-fC:/DOCUME~1/MICHAE~1/LOCALS~1/Temp/magick-gOgISD3g" "-fC:/DOCUME~1/MICHAE~1/LOCALS~1/Temp/magick-lS6IAndt"
@ utility.c/SystemCommand/1963.
convert: Postscript delegate failed `\path\to\TempConversion\temp.pdf': No
such file or directory @ pdf.c/ReadPDFImage/634.
convert: missing an image filename `temp.tif' @ convert.c/ConvertImageCommand/2838.



Uses too much disk space

wWhen processing a large document, umpteen tem files are written ... to the temp/tmp directory. If you hard-drive is near capacity and the tmp folder fills up, processing will quit unexpectedly (although all tmp files will be deleted at that point). In my case, “near” was 16Gigabytes (I was processing a 800,000 MB file).


But you can temporarily change the tmp directory to another drive, if you have one:


SET TMP=e:\tmp
SET TEMP=e:\tmp



Misc commands

Convert multi-page to single-page


convert multi-page.tif single-page%03d.tif


%03d is a standard printf formatting code



Text conversion


convert text:SampleSubject.eml sample.tif


This command line works for text files. Replace 200974281 with whatever you need.
Outputs a 1 bit per pixel, 200dpi, but not G4 compressed tiff.  Quality is not awesome.  Note the full path to convert.exe is not needed if your environment variable is working properly.
convert.exe text:200974281.txt -monochrome -type bilevel -resample 200x200 200974281.tif


Had to add the compress option to get G4s:

convert.exe text:200974281.txt -monochrome -compress group4 -type  bilevel  -resample 200x200 200974281.tif



Animated GIF
See Also: GIF



See Also




Category tags

Programming imageConversion



No comments yet.



Add Comment

 Your Message
 Enter value ← Have you entered the code number?