Reputation: 4102
I recently tried imagemagick and wanted to ask how I create an image (.bmp file) which looks like this:
My current code looks like this:
convert -size 720x480 xc:blue \ -fill white -stroke black -strokewidth 0 -draw "line 5,20 95,20" \ myImage.bmp
Upvotes: 1
Views: 1089
Reputation: 207465
I would probably go with this:
convert xc:black[720x480\!] -size 100x5 \
\( xc:lime xc:blue -append -write MPR:stripe \) -geometry +165+400 -composite \
MPR:stripe -geometry +295+400 -composite \
MPR:stripe -geometry +425+400 -composite result.png
The interesting part is the second line where I create a lime green rectangle and a blue one the same size underneath (-append
) and save that in an MPR (Magick Persistent Register) called stripe
, then I re-use that to make each subsequent stripe.
Or this:
convert -size 720x480 xc:black -strokewidth 5 \
-stroke lime \
-draw "line 165,400 265,400" -draw "line 295,400 395,400" -draw "line 425,400 525,400" \
-stroke blue \
-draw "line 165,405 265,405" -draw "line 295,405 395,405" -draw "line 425,405 525,405" myImage.bmp
Upvotes: 3
Reputation: 5299
You have some rubbish in your command but it has done what you asked it to - draw a black line on a blue background.
This should get you started:
convert -size 720x480 xc:black -strokewidth 5 -stroke green -fill none -draw "line 50,200 95,200" -stroke blue -draw "line 50,205 95,205" myImage.bmp
Upvotes: 0