0

I try to convert pdf file to png image in ImageMagick from windows 10 command line as follows:

convert a.pdf a.png

But I get error: Invalid Parameter - a.png. I'd like to know why. ImageMagick has been installed correctly as magick wizard.jpg win: popup an image.

  • Possible duplicate of [How to override Windows' convert command by ImageMagick's one?](https://stackoverflow.com/questions/4481573/how-to-override-windows-convert-command-by-imagemagicks-one) – user2314737 Feb 02 '18 at 21:51

3 Answers3

2

To expand on @Ben Harris answer Windows has a convert program that from memory renames files which will be selected by default. If you allowed Imagemagick to add itself to the environmental variables on install it should have worked.

You can either change convert to the path of Imagemagick convert.exe or rename convert.exe to something else (such as IMconvert.exe) to stop the confusion. Then use IMconvert.exe in place of convert.

As @user2314737 says the version 7 of Imagemagick uses magick rather than convert to prevent that problem. (try magick.exe)

fmw42
  • 28,780
  • 5
  • 37
  • 49
Bonzo
  • 4,836
  • 1
  • 15
  • 25
0

My guess is that you are calling the wrong convert. Use where to determine which executable that you are actually running.

Additionally, make sure you watch out for some of the strange behaviors of imagemagick on windows.

Ben Harris
  • 537
  • 5
  • 10
0

convert might be another command on Windows (see convert issue)

Note also that starting from version 7

The "magick" command is the new primary command of the Shell API, replacing the old "convert" command.

(from https://imagemagick.org/script/porting.php)

so you should use:

magick a.pdf a.png
user2314737
  • 21,279
  • 16
  • 81
  • 95