Page 1 of 1

Adding text to an image

Posted: 2008-04-14T01:57:42-07:00
by rottmanj
I am working on a project where I need to add text to an image. I have the bulk of the work done, but I have run into a few stumbling points.

So far this is what I have

Code: Select all

convert -font helvetica -pointsize 9 -draw "text 167,554 'userName' text 145,596 'userTitle'" img1.jpg img1b.jpg
The issue I have having is that userName uses a 9pt font at 300 dpi and userTitle uses a 7pt font at 300dpi. When I run the command above, both items of text are at 9pt and 96 dpi. So how to I write it so that the first item of text is at 9pt 300 dpi and the second is at 7pt 300 dpi?

Any help with this is greatly appreciated.

Re: Adding text to an image

Posted: 2008-04-14T10:25:24-07:00
by fmw42
Typically, the proper syntax for convert is to have the input image right after the word "convert"

convert inputimage ...options... outputimage

I suspect all images are getting your options applied. Try the above and see if that helps.

Re: Adding text to an image

Posted: 2008-04-14T12:46:17-07:00
by Bonzo
No idea about the 300dpi part but this will give you 2 different font sizes:

Code: Select all

convert img1.jpg -font helvetica -pointsize 9 -draw "text 167,554 'userName'" -pointsize 7 -draw "text 145,596 'userTitle'" img1b.jpg