No matter what, second parameter of convert always invalid.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
blindley
Posts: 3
Joined: 2011-10-20T10:27:31-07:00
Authentication code: 8675308

No matter what, second parameter of convert always invalid.

Post by blindley »

I'm trying out some things from the examples on the main site, like this:

Code: Select all

convert -background lightblue -fill blue -font Candice -pointsize 72 label:Anthony label.gif
I get the error:

Code: Select all

Invalid Parameter - lightblue
In fact, no matter what I enter, as long as there are 2 or more parameters, it always just tells me the second parameter is invalid. I'm doing this in Windows Powershell.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: No matter what, second parameter of convert always inval

Post by Bonzo »

Can you get anything to work? The problem may be that windows is using its convert program and not Imagemagicks.
blindley
Posts: 3
Joined: 2011-10-20T10:27:31-07:00
Authentication code: 8675308

Re: No matter what, second parameter of convert always inval

Post by blindley »

Bonzo wrote:Can you get anything to work? The problem may be that windows is using its convert program and not Imagemagicks.
Yes, that was it. Thanks. I moved ImageMagick to the front of my path now.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: No matter what, second parameter of convert always inval

Post by Bonzo »

Yes, that was it. Thanks. I moved ImageMagick to the front of my path now.
Thats interesting as most people seem to rename the Imagemagicks convert program - I have never had this problem on any of my installs - so making Imagemagick the first item on the enviromental path fixes it?
blindley
Posts: 3
Joined: 2011-10-20T10:27:31-07:00
Authentication code: 8675308

Re: No matter what, second parameter of convert always inval

Post by blindley »

Bonzo wrote:Thats interesting as most people seem to rename the Imagemagicks convert program
Well, I would do that, but seeing as how I've never ever used or even heard of this Windows convert program, and I have no idea what it does and doubt I'll ever use it, I'm not worried about the name collision. Besides, when I add things to my path, it's only on a per powershell-session basis. I have a script that allows me to simply type

Code: Select all

Add-Path("imagemagick","python3","whateverelse")
and voila. It used to add them to the end, now it adds them to the beginning.
Bonzo wrote:so making Imagemagick the first item on the enviromental path fixes it?
Yep.
lekagour
Posts: 1
Joined: 2017-04-21T04:51:52-07:00
Authentication code: 1151

Re: No matter what, second parameter of convert always invalid.

Post by lekagour »

Hi. I am trying to run this command via R. I am using the following command: `system("convert -delay 80 *.png example_1.gif")` and i get the same error. Does anyone know how could i fix it ? (i do not know how to add imagemagick in the path also)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: No matter what, second parameter of convert always invalid.

Post by snibgo »

I don't know R. Perhaps it has documentation that tells you how to change the path. Or perhaps it simply inherits the path from the operating system (Windows, Unix, whatever).
snibgo's IM pages: im.snibgo.com
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: No matter what, second parameter of convert always invalid.

Post by Rye »

Sorry for the gravedigging, but as I installed ImageMagick-7.0.7-28-Q16-x64-static today, the "convert" command appears to show similar behaviour as outlined here.

Is there a simple (cmd ?) fix for this ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: No matter what, second parameter of convert always invalid.

Post by snibgo »

At your v7 installation, you probably didn't tick the box for "legacy" components, so it didn't install convert.exe, so that command runs the Microsoft program.

I suggest you use "magick" instead of "convert".
snibgo's IM pages: im.snibgo.com
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: No matter what, second parameter of convert always invalid.

Post by Rye »

Ok. However, which of these "is" the "legacy checkbox" ?

Image

The problem isn't "convert.exe"... I rely on "mogrify" for many scripts (for which I don't want to change it)...
Last edited by Rye on 2018-04-28T10:11:08-07:00, edited 1 time in total.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: No matter what, second parameter of convert always invalid.

Post by fmw42 »

IM 7 uses magick. When you use convert, it is actually running the legacy IM 6. So if you really want the new features of IM 7, then use magick, not convert.
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: No matter what, second parameter of convert always invalid.

Post by Rye »

Ah ok, that makes sense.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: No matter what, second parameter of convert always invalid.

Post by snibgo »

From ImageMagick-7.0.7-28-Q16-HDRI-x64-dll.exe, I get this:
Image
I don't know why you don't have that option.

For "mogrify", "identify" etc use "magick mogrify", "magick identify" etc.
snibgo's IM pages: im.snibgo.com
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: No matter what, second parameter of convert always invalid.

Post by Rye »

I know why.
The static built is missing that option.
The others have it.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
muccigrosso
Posts: 64
Joined: 2017-10-03T10:39:52-07:00
Authentication code: 1151

Re: No matter what, second parameter of convert always invalid.

Post by muccigrosso »

fmw42 wrote: 2018-04-28T10:10:28-07:00 IM 7 uses magick. When you use convert, it is actually running the legacy IM 6. So if you really want the new features of IM 7, then use magick, not convert.
This is good to know since IM's behavior on this seems a bit misleading. That is, on my High Sierra system, I get the following identical output when getting the version of both commands:

Code: Select all

 > convert -version
Version: ImageMagick 7.0.7-28 Q16 x86_64 2018-03-26 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib fontconfig freetype jbig jng jp2 jpeg lcms ltdl lzma png tiff x xml zlib
 > magick -version
Version: ImageMagick 7.0.7-28 Q16 x86_64 2018-03-26 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib fontconfig freetype jbig jng jp2 jpeg lcms ltdl lzma png tiff x xml zlib
I have only v. 7 installed (via homebrew).

Yet it does look like `convert` is not the same as `magick`, though it is the same as `magick convert`, based on its inability to use the new fx function, as in

Code: Select all

magick rose: -resize %[fx:w*5]x show:
That is, replacing or supplementing `magick` with `convert` results in an error, whereas `magick` all by itself works as expected.

Is there an easier way to tell/show that convert is actually using version 6?
Post Reply