Page 1 of 1
Syntax problems or installed wrong.
Posted: 2013-11-09T18:39:38-07:00
by wappy
I appear to be having problem with the proper syntax and I wanted to see if anyone could see what i am doing wrong.
If I use this command it outputs images:
convert rose: rose_bg_mask.png
If I use this command it does not work, it appears the backslach is causing problems but i copied it from the example at
"
http://www.imagemagick.org/Usage/masking/". Does anyone see a problem with what i am doing wrong?
brad@ubuntu:~/Documents$ convert rose: -mask rose_bg_mask.png \ -modulate 110,100,33.3 +mask rose_blue.png
convert: unable to open image ` -modulate': @ error/blob.c/OpenBlob/2587.
convert: no decode delegate for this image format ` -modulate' @ error/constitute.c/ReadImage/532.
convert: unable to open image `110,100,33.3': @ error/blob.c/OpenBlob/2587.
convert: no decode delegate for this image format `110,100,33.3' @ error/constitute.c/ReadImage/532.
brad@ubuntu:~/Documents$
identify --version
Version: ImageMagick 6.6.9-7 2012-08-17 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
Re: Syntax problems or installed wrong.
Posted: 2013-11-09T18:49:35-07:00
by snibgo
In Unix etc you use a backslash to break a command into more than one line. If you are not breaking the command, don't use a backslash.
Re: Syntax problems or installed wrong.
Posted: 2013-11-09T19:23:14-07:00
by wappy
Well if i remove the backslash then i get a different error:
brad@ubuntu:~/Documents$ sudo convert rose: -mask rose_bg_mask.png -modulate 110,100,33.3 +mask rose_blue.png
convert: unable to open image `rose_bg_mask.png': @ error/blob.c/OpenBlob/2587.
convert: unable to open file `rose_bg_mask.png' @ error/png.c/ReadPNGImage/3238.
brad@ubuntu:~/Documents$
I thought maybe it was a permissions issues so i used sudo.
Any idea's? heh
Thanks
Re: Syntax problems or installed wrong.
Posted: 2013-11-09T20:22:32-07:00
by fmw42
Possibly a bug in your IM version. Your version 6.6.9.7 is rather old. The command from
http://www.imagemagick.org/Usage/masking/#write_mask works fine for me on IM 6.8.7.5 Q16 Mac OSX
convert rose: -mask rose_bg_mask.png -modulate 110,100,33.3 +mask rose_blue.png
The only other possible issue is that you may not have read/write permission in the directory you are working in.
Is IM configured to work with png files?
Is it listed in convert -list configure, under DELEGATES?
Re: Syntax problems or installed wrong.
Posted: 2013-11-09T20:31:32-07:00
by snibgo
Do you have the file rose_bg_mask.png in your current directory? If not, that's the problem. You can download it from the web page (right-click, etc).
Re: Syntax problems or installed wrong.
Posted: 2013-11-09T23:44:09-07:00
by wappy
@snibgo, I believe these png files are built into IM for testing basically functionality and examples. Or am I wrong? i don't know
@Fred, thanks for the suggestions, The old version of IM is the one that auto installs using apt-get. I just compiled IM and installed the new version. below are the results.
I just ran the following command:
brad@ubuntu:~/Documents$ convert rose: -mask rose_bg_mask.png -modulate 110,100,33.3 +mask rose_blue.png
convert: unable to open image `rose_bg_mask.png': No such file or directory @ error/blob.c/OpenBlob/2643.
convert: unable to open file `rose_bg_mask.png' @ error/png.c/ReadPNGImage/3995.
brad@ubuntu:~/Documents$
I just checked the permissions for the folder i am running the command in and they look fine to me.
drwxr-xr-x 7 brad brad 4096 Nov 9 19:20 Documents
convert -list configure, under DELEGATES
DELEGATES bzlib djvu mpeg fontconfig freetype jng jp2 jpeg lcms lqr openexr pango png ps tiff x xml zlib
identify --version
Version: ImageMagick 6.8.7-5 Q16 i686 2013-11-08
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib djvu fontconfig freetype jng jp2 jpeg lcms lqr openexr pangocairo png tiff x xml zlib
Re: Syntax problems or installed wrong.
Posted: 2013-11-10T00:36:07-07:00
by dlemstra
wappy wrote:@snibgo, I believe these png files are built into IM for testing basically functionality and examples. Or am I wrong? i don't know
The file rose_bg_mask.png is not a built in file, rose: is.
Re: Syntax problems or installed wrong.
Posted: 2013-11-10T00:54:08-07:00
by fmw42
Re: Syntax problems or installed wrong.
Posted: 2013-11-10T08:47:05-07:00
by wappy
Thanks for clarification on which files are built in. So i thought i would try to drill down on a single option.
If i type this command i get an error it does not seem to see the file name which is the argument.
brad@ubuntu:~/Documents$ convert rose: -mask rose_bg_mask.png
convert: option requires an argument `-mask' @ error/convert.c/ConvertImageCommand/2020.
brad@ubuntu:~/Documents$
However if I put a plus (random trying stuff) then the command does see the file however the output is not what i expected it looks identical to the rose: i was expecting a black outline of the rose outline.
brad@ubuntu:~/Documents$ convert rose: +mask rose_bg_mask.png
brad@ubuntu:~/Documents$
If anyone has any suggestions let me know.
Thanks
Re: Syntax problems or installed wrong.
Posted: 2013-11-10T09:11:22-07:00
by snibgo
Code: Select all
convert rose: +mask rose_bg_mask.png
That command:
1. Reads the "rose:" image (which is built in).
2. Turns off the mask feature (which isn't on, so thiat does nothing).
3. Writes the current image to a file named rose_bg_mask.png.
So you should now have a file with that name. It will look exactly like the rose: image.
To get the rose_bg_mask.png used by the web page, download it from the web page.
Re: Syntax problems or installed wrong.
Posted: 2013-11-10T10:45:10-07:00
by snibgo
I should also point you to the documentation:
http://www.imagemagick.org/script/comma ... s.php#mask
"-mask" needs an argument, which is an input filename. The file must already exist. And then you need another filename for the output file.
"+mask" turns off the mask feature, and takes no argument. So the next filename is taken as the output file.
Re: Syntax problems or installed wrong.
Posted: 2013-11-10T14:37:17-07:00
by wappy
thanks snibgo
I'm still pretty new to ImageMagicK and i guess it is showing hehe.
I tried the command like you instructed and it worked fine.