convert type to graphic, size not working

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bhumes

convert type to graphic, size not working

Post by bhumes »

Hi all,

New to IM, so please go easy on me...

Here is my code:

Code: Select all

convert -fill green -font "c:\WINDOWS\Fonts\tt1046m_.ttf" label:"Welcome Back Jessica" -size 500x "c:\pathtoimages\Jessica.gif"
I'm expecting an image that is 500 pixels wide with the words "Welcome Back Jessica" as large as possible in the space.

What I'm getting is a very small image (65x14). The words appear correctly, but the image is much too small.

Please help. Thank you!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert type to graphic, size not working

Post by fmw42 »

try

convert -size 500x500 xc:green -font "c:\WINDOWS\Fonts\tt1046m_.ttf" label:"Welcome Back Jessica" "c:\pathtoimages\Jessica.gif"

This should make a 500x500 green image with your font in it. But you need to tell it what size font you want and what color font you want and where you want it placed.

See

http://www.imagemagick.org/Usage/text/
http://www.imagemagick.org/Usage/annotating/
bhumes

Re: convert type to graphic, size not working

Post by bhumes »

Thanks for you reply.

I tried a couple things based on your post and I found that the problem was that I need to declare the size first. So, the following works just fine:

Code: Select all

convert -size 400x -fill green -font "c:\WINDOWS\Fonts\tt1046m_.ttf" label:"Welcome Back Jessica" "c:\pathtoimages\Jessica.gif"
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert type to graphic, size not working

Post by anthony »

See IM Examples, Basics.

Settings are saved and Operations applied in command line oder.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
bhumes

Re: convert type to graphic, size not working

Post by bhumes »

Thank you, Anthony. I missed that the first time around.
Post Reply