Wednesday, July 11, 2012

Adding labels to figures using ImageMagick



This is a 1200x1200 pixel blank file to which I added labels as an exercise in using the annotate flag in ImageMagick's convert.
 
convert blank.gif -pointsize 50 \
-gravity south -append -annotate +000+000 '0s' \
-gravity south -append -annotate +100+100 '1s' \
...

-gravity south -append -annotate +900+900 '9s' \
-gravity north -append -annotate +000+000 '0n' \
-gravity north -append -annotate +100+100 '1n' \
...

-gravity north -append -annotate +900+900 '9n' \
-gravity northwest -append -annotate +000+000 '0nw' \
-gravity northwest -append -annotate +100+100 '1nw' \
...

-gravity northwest -append -annotate +900+900 '9nw' \
-gravity northeast -append -annotate +000+000 '0ne' \
-gravity northeast -append -annotate +100+100 '1ne' \
...

-gravity northeast -append -annotate +900+900 '9ne' \
out.png

No comments:

Post a Comment