Convert : unable to open image... invalid argument. (beginne

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?".
Post Reply
kostina

Convert : unable to open image... invalid argument. (beginne

Post by kostina »

Hello,

I'm just discover ImageMagick. Fantastic !!!
I learn with Windows XP (binary version).
Only, the syntax is not simple for me :
For that the example below works :
convert rose: \( +clone -channel R -fx B \) \
+swap -channel B -fx v.R fx_rb_swap.gif
I've had to delete the 3 "\".
So, if I use a picture present in the directory "images" like rose, it works.

But if I want to use my own picture that I've placed inside this directory, like that, after the command prompt :
convert myPhoto: ( +clone -channel R -fx G ) +swap -channel G -fx v.R myPhotoGreen.gif
I get this message :
> convert: unable to open image 'myPhoto:' : invalid argument...
I'm looking for since 2 days unsuccessfully ;-(

Better, I used successfully this name of file for another operation !
What I'v missed ?!

Thanks
Rosa
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert : unable to open image... invalid argument. (beginne

Post by Bonzo »

I have not used windows but assume you will need the full path to the image not the relative path. Something like c:\folder name\image.jpg and the same for saving it.
Also you use image: for the built in images not your images.

Code: Select all

convert c:\folder name\myPhoto.jpg ( +clone -channel R -fx G ) +swap -channel G -fx v.R c:\folder name\myPhotoGreen.gif
kostina

Re: Convert : unable to open image... invalid argument. (beginne

Post by kostina »

No it doesn't work. Always the same problem.
First, there's error with "Program Files" for the blank.
Then, I've got placed my picture in the directory images of the program, where there the pictures of the program (exemple : rose...). So, IM knows the path by default ?!
Since, I've got the same command with others pictures of IM in his directoriy : it doesn't work, except for rose ?!

I don't understand anything.

Rosa
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert : unable to open image... invalid argument. (beginne

Post by Bonzo »

This works for me:

1/ Open Command prompt.

2/ Using cd directory name get to the directory with the original image in - in my case I went
cd \ to take me back to the root.
Then after the c:\ prompt
cd Documents and Settings\Barney\My Documents

You can look at image properties to find the path you need.

3/ I then ran convert test.jpg -resize 50x50 output.gif

I now have an image called output.gif in the My Documents folder.

The Rose image may work as it is hard coded into the software somewhere?
kostina

Re: Convert : unable to open image... invalid argument. (beginne

Post by kostina »

It seems to me that I don't understand what you wrote. The 2/ part in fact.
The path where are the pictures by default is :
C:\Program Files\ImageMagick-6.3.4-Q16\images

So, Program Files gets an error because of the blank beetwen the 2 words.
I let the install place the program IM as it was proposed.
Do have I understand that I should reinstall IM outside the Program Files ?

Rosa
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert : unable to open image... invalid argument. (beginne

Post by Bonzo »

How are you running your code ? I was using the command prompt screen.

cd \

cd Program Files\ImageMagick-6.3.4-Q16\images

convert image.jpg -resize 50x50 output.gif

Should create an image called output.gif from image.jpg in the folder C:\Program Files\ImageMagick-6.3.4-Q16\images
kostina

Re: Convert : unable to open image... invalid argument. (beginne

Post by kostina »

cd:\> Program Files\ImageMagick-6.3.4-Q16\images
get a message error :
'Program' is not a internal command, or extrnal or a executable... (I translate form french).

Rosa
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert : unable to open image... invalid argument. (beginne

Post by Bonzo »

You are not doing what I wrote; this is what you should be seeing:
http://www.rubblewebs.co.uk/TESTS/kostina.php

Replace the filenames on this line with your filenames: convert image.jpg -resize 50x50 output.gif
kostina

Re: Convert : unable to open image... invalid argument. (beginne

Post by kostina »

Ok, I forgot
Type convert image.jpg -resize 50x50 output.gif
kostina

Re: Convert : unable to open image... invalid argument. (beginne

Post by kostina »

I did a error and the message is away yesterday : I was very tried after 10 heures behind the screen...

I tried as you told.
To resizing, it works. But if I want apply the example to transform the chromatic, I've got the same message after having indicate the good directory as you indicated me.
(convert rose: \( +clone -channel R -fx B \) \
+swap -channel B -fx v.R fx_rb_swap.gif)

I don't understand anything... :(

Rosa
kostina

Re: Convert : unable to open image... My fault !

Post by kostina »

It's my fault !!!
after the name of the file input, I wrote ":" as the exemple (rose: by default).
I don't know his significant yet, but I understand.
Thanks ever so much to you because I was ready to abandon without your help.

Rosa
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert : unable to open image... invalid argument. (beginne

Post by Bonzo »

I am glad you got it working in the end :D
Post Reply