Very Newbie - gap betw. documentation & what works

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
dbdavis

Very Newbie - gap betw. documentation & what works

Post by dbdavis »

After successful download and install, I went to try it out on my Windows 7 system. At a place in the documentation (which I now cannot find), I encountered the following:

convert -size 320x90 xc:none -stroke snow4 -size 1x90 -tile gradient:white-snow4 \
-draw 'roundrectangle 16, 5, 304, 85 20,40' +tile -fill snow \
-draw 'roundrectangle 264, 5, 304, 85 20,40' -tile gradient:chartreuse-green \
-draw 'roundrectangle 16, 5, 180, 85 20,40' -tile gradient:chartreuse1-chartreuse3 \
-draw 'roundrectangle 140, 5, 180, 85 20,40' +tile -fill none
-draw 'roundrectangle 264, 5, 304, 85 20,40' -strokewidth 2 \
-draw 'roundrectangle 16, 5, 304, 85 20,40' \( +clone -background snow4 -shadow 80x3+3+3 \) +swap \
-background none -layers merge \( +size -font Helvetica -pointsize 90 -strokewidth 1 \
-fill red label:'50 %' -trim +repage \( +clone -background firebrick3 -shadow 80x3+3+3 \) +swap \
-background none -layers merge \) -insert 0 -gravity center -append -background white \
-gravity center -extent 320x200 \
cylinder_shaded.png

Please note -the above is a reconstruction, since I edited it, but cannot now find the original. After pasting it into a command prompt, it was obvious that I needed to delete the '\' and either make one long line which Windows permits, or to use '^' for line continuation. After trying that it gave the message: 'Invalid parameter 320x90' I tried a variety of things such as quotes around the numbers only, quotes around the entire thing, etc., but none worked. I searched for other examples of 'size' within Windows -- no help. How may the above command be entered within Windows 7 and work?

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

Re: Very Newbie - gap betw. documentation & what works

Post by Bonzo »

You need to cd\ first to get back to C: and this gets rid of the size error. You do not ( I think ) need to escapet the ( & ) and as you say change the \ to ^ I also replaced the ' for " to be on the safe side and ended up with:

Code: Select all

convert.exe -size 320x90 xc:none -stroke snow4 -size 1x90 -tile gradient:white-snow4 ^
-draw "roundrectangle 16, 5, 304, 85 20,40" +tile -fill snow ^
-draw "roundrectangle 264, 5, 304, 85 20,40" -tile gradient:chartreuse-green ^
-draw "roundrectangle 16, 5, 180, 85 20,40" -tile gradient:chartreuse1-chartreuse3 ^
-draw "roundrectangle 140, 5, 180, 85 20,40" +tile -fill none ^
-draw "roundrectangle 264, 5, 304, 85 20,40" -strokewidth 2 ^
-draw "roundrectangle 16, 5, 304, 85 20,40" ( +clone -background snow4 -shadow 80x3+3+3 ) +swap ^
-background none -layers merge ( +size -font Arial -pointsize 90 -strokewidth 1 -fill red label:"50 %" -trim +repage ( +clone -background firebrick3 -shadow 80x3+3+3 ) +swap -background none -layers merge ) ^
-insert 0 -gravity center -append -background white ^
-gravity center -extent 320x200 ^
cylinder_shaded.png
I had to change the font as I do not have Helvetica on my Windows Vista PC and I have had problems in the past splitting ( & ) on different lines.

The image will be saved on C:
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Very Newbie - gap betw. documentation & what works

Post by anthony »

this comes from the discussion
[SOLVED] Better way to produce this png ?
viewtopic.php?f=1&p=66100

And while it will not be useful to a Windows user, a Bash script for this is located in
http://www.imagemagick.org/Usage/scripts/cylinder_bar
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply