Page 1 of 1

Convert and draw same command issue

Posted: 2012-04-11T17:07:16-07:00
by hcorreia
This i my first post and I could not find the answer.
I am using Windows XP to run IM. I have an image that I am trying to put a blank image over a certain area. I have created a blank image 1x1 I go to my directory and run the command below and get the error also below
convert card.png -draw 'image SrcOver 0,65 1000,1000 point.png' cardnew.png
C:\testi[/color]ng>convert card.png -draw 'image SrcOver 0,65 1000,1000 point.png' cardn
ew.png
convert.exe: Non-conforming drawing primitive definition `image' @ error/draw.c/
DrawImage/3146.
convert.exe: unable to open image `SrcOver': No such file or directory @ error/b
lob.c/OpenBlob/2617.
convert.exe: no decode delegate for this image format `SrcOver' @ error/constitu
te.c/ReadImage/533.
convert.exe: unable to open image `0,65': No such file or directory @ error/blob
.c/OpenBlob/2617.
convert.exe: no decode delegate for this image format `0,65' @ error/constitute.
c/ReadImage/533.
convert.exe: unable to open image `1000,1000': No such file or directory @ error
/blob.c/OpenBlob/2617.
convert.exe: no decode delegate for this image format `1000,1000' @ error/consti
tute.c/ReadImage/533.
convert.exe: unable to open image `point.png'': No such file or directory @ erro
r/blob.c/OpenBlob/2617.
convert.exe: no decode delegate for this image format `point.png'' @ error/const
itute.c/ReadImage/533.
convert.exe: Non-conforming drawing primitive definition `image' @ error/draw.c/
DrawImage/3146.[/color]


Can anyone tell me what I am doing wrong?
Thank you

Re: Convert and draw same command issue

Posted: 2012-04-11T18:00:27-07:00
by fmw42
See the syntax at http://www.imagemagick.org/Usage/layers/#draw. You need double quotes outside for the draw command and single quotes about your image.

But I am not sure you can draw a transparent image into another image that way. I could be wrong.

For other ways to draw a rectangular "hole" see
http://www.fmwconcepts.com/imagemagick/ ... nsert_hole
http://www.imagemagick.org/Usage/compose/#copy
http://www.imagemagick.org/Usage/compose/#dstout
http://www.imagemagick.org/Usage/draw/#matte

Re: Convert and draw same command issue

Posted: 2012-04-11T18:11:45-07:00
by hcorreia
Thank you so much that did it. Yes this worked it covered the image thank you again

C:\testing>convert card.png -draw "image SrcOver 0,65 1000,1000 'point.png'" car
dnew.png

Re: Convert and draw same command issue

Posted: 2012-04-11T18:12:54-07:00
by hcorreia
Since I have you any idea the command to do this in batches?

Re: Convert and draw same command issue

Posted: 2012-04-11T18:17:20-07:00
by fmw42
hcorreia wrote:Since I have you any idea the command to do this in batches?

see mogrify
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/basics ... fy_compose

Re: Convert and draw same command issue

Posted: 2012-04-11T18:21:36-07:00
by fmw42
hcorreia wrote:Thank you so much that did it. Yes this worked it covered the image thank you again

C:\testing>convert card.png -draw "image SrcOver 0,65 1000,1000 'point.png'" car
dnew.png
That command does not work for me using a fully transparent point.png! Is your point.png transparent?

In fact, there is no src_over listed at http://www.imagemagick.org/Usage/compose/

Re: Convert and draw same command issue

Posted: 2012-04-11T19:56:28-07:00
by hcorreia
card.png is the original image before command execution. I created small point.png (1x1) of white color to use in below command. Below is the command which fulfills over requirement.

convert card.png -draw "image SrcOver 0,65 1000,1000 'point.png"' car
dnew.jpeg

Re: Convert and draw same command issue

Posted: 2012-04-11T19:59:01-07:00
by fmw42
hcorreia wrote:card.png is the original image before command execution. I created small point.png (1x1) of white color to use in below command. Below is the command which fulfills over requirement.

convert card.png -draw "image SrcOver 0,65 1000,1000 'point.png"' car
dnew.jpeg

For me it does not make it transparent, simply white. Is that what you wanted. I thought your original post was about making a transparent section inside an image. Perhaps I misunderstood what you meant by "blank".

Re: Convert and draw same command issue

Posted: 2012-04-11T20:15:32-07:00
by hcorreia
Sorry for the confusion. I have an index card and needed to blank information or cover it up and only leave the header. The command did that after your correction of course. I cant post files or else I would have post before and after.

Re: Convert and draw same command issue

Posted: 2012-04-11T20:56:00-07:00
by anthony
hcorreia wrote:This i my first post and I could not find the answer.
I am using Windows XP to run IM. I have an image that I am trying to put a blank image over a certain area. I have created a blank image 1x1 I go to my directory and run the command below and get the error also below
convert card.png -draw 'image SrcOver 0,65 1000,1000 point.png' cardnew.png
C:\testi[/color]ng>convert card.png -draw 'image SrcOver 0,65 1000,1000 point.png' cardn
ew.png
convert.exe: Non-conforming drawing primitive definition `image' @ error/draw.c/
DrawImage/3146.
...[/color]

Can anyone tell me what I am doing wrong?
Thank you

You did not add single or double quotes around the filename in the draw.

However is their some reason you specifically want to overlay using draw? By not use -composite

Re: Convert and draw same command issue

Posted: 2012-04-12T09:28:09-07:00
by hcorreia
Thre is no reason really, I guess I thought this was the correct way of doing this.
How can I redirect the output file to a different folder, do you know?

Re: Convert and draw same command issue

Posted: 2012-04-12T11:31:23-07:00
by fmw42
hcorreia wrote:Thre is no reason really, I guess I thought this was the correct way of doing this.
How can I redirect the output file to a different folder, do you know?
if using convert, then just put the path to the output image in your command

convert image ..... path2newdirectory/outputimage

Re: Convert and draw same command issue

Posted: 2012-04-12T11:48:51-07:00
by hcorreia
Ok that makes since but do I need to cd like the command below?

convert card.png -draw 'image SrcOver 0,65 1000,1000 point.png' cd../newpath/cardnew.png


Thank you again

Re: Convert and draw same command issue

Posted: 2012-04-12T12:42:03-07:00
by fmw42
hcorreia wrote:Ok that makes since but do I need to cd like the command below?

convert card.png -draw 'image SrcOver 0,65 1000,1000 point.png' cd../newpath/cardnew.png


Thank you again

No leave off the cd..

convert card.png -draw 'image SrcOver 0,65 1000,1000 point.png' /newpath/cardnew.png

The directory must exist already and must have write permissions.

Re: Convert and draw same command issue

Posted: 2012-04-12T21:58:16-07:00
by anthony
The other technique is to use "mogrify" whcih has a output -path option

However it will generally only use the same basename as the input image.
But mogrify can process multiple images in the same directory.

http://www.imagemagick.org/Usage/basics/#mogrify