Convert can be used to draw curves, lines, circles, ellipses, rectangles, polygons, texts, and even to mix two images. Although we will introduce the -draw
parameters during this book, the complete list is provided in Appendix B.
This is the overall syntax of the -draw
option.
-draw '<our shape> coordinates'
In this scheme instead of<our shape>
we can place our desired shape keyword (that is, circle or rectangle). For example the following command will draw a black line from (10,10)
to (70,90)
on a white page with 80x100 dimensions and then save the result in a bitmap file:
convert size 80x100 xc:white -draw 'line 10,10 70,90' line.bmp
As you can see with this convert
command four options are used. The part of this command which draws the line is:
-draw 'line 10,10 70,90'
In which 10,10
indicates the coordinates of the start point and 70,90
indicates the end point of the line. At the beginning of this command there is a size
option, which...