-1

I want to create an image containing "word" as an image which is centrally assigned . I used the following command :

echo "word" | convert -font Helvetica -pointsize 32 label:@- cmd.png

but the resulting image I got does not centrally align the image and also I want to have my image automatically cropped with respect to word . I am not able to find any flag which can do so .

Deepesh
  • 99
  • 2
  • 11

1 Answers1

0

Imagemagick will attempt to grow the image size to include all the characters read from . Use the -trim flag to reduce the image to the nearest pixel

echo "Words are nice" | convert -font Helvetica -pointsize 32 label:@- -trim -border 1 cmd.png

Words are nice

border added for reference

emcconville
  • 23,800
  • 4
  • 50
  • 66