Alexwall
Alexwall

Reputation: 667

imagemagick with grayscale not working

I am trying to change a file named "anvil_base.png" to grayscale so I am using imagemagick. What I am entering is convert anvil_base.png -colorspace Gray -gamma 2.2 anvil_base.png

but it is just returning this

Invalid Parameter - -colorspace

What am I doing wrong?

Upvotes: 1

Views: 704

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 208052

I suspect you are on Windows and you have not put the directory where ImageMagick is installed ahead of other directories in your PATH. You have three choices:

Option 1

As Glenn kindly points out, if you are using ImageMagick version 7 or newer, you can use the new name for convert which is magick, like this:

magick image.png -colorspace gray ...

Option 2

Use the full path to ImageMagick every time, something like this:

C:\ImageMagick-6.9.3\convert ...

Option 3

Change your PATH. So you would need to do:

Start->Programs->Control Panel->System->Advanced

and then choose Environment Variables and change PATH so that it looks like:

PATH=C:\ImageMagick-6.9.3;C:\Windows;C:\Windows\System32

The main thing is that ImageMagick directory is at the start of the PATH. Then Windows will find the convert which is part of ImageMagick before it finds the built-in Windows convert program which converts FAT filesystems to NTFS. If you choose Option 3 above, you need to either log out and back in again, or start a new Command Prompt for the new PATH to become active.

Upvotes: 2

Related Questions