O'Reilly logo

ImageMagick Tricks by Sohail Salehi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to Draw Basic Shapes with Convert

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required