Change the font and size of a text label

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
justme24

Change the font and size of a text label

Post by justme24 »

Hello is it possible to change the font and size of a text label like, composite -geometry +48+41 label:Anthony?
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Change the font and size of a text label

Post by el_supremo »

The composite command has a -font option but it appears that it doesn't have the -pointsize option (which is available in the convert command). It looks like you would have to use convert to get both and if you are trying to generate a "signature" on an image, convert can do that too. For example, this command will add the name "Anthony" to the bottom left corner of the built-in logo: image.

Code: Select all

convert logo: -font Times-New-Roman -pointsize 24 -gravity southwest -annotate +10+10 "Anthony" logo_sig.jpg
Pete
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Change the font and size of a text label

Post by anthony »

In the mean time, if no -pointsize is given label: can use -size to
define the final size of the label image (adjusting the font size to fit that size). and "composite" does understand -size!

Alternatively you can use the "convert" command -composite instead of using "composite", seeing as you are not using one of the "composite" command only features (EG: image composite tiling, -displace, -blend, -dissolve).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply