6

I'm trying to convert a text label into image using imagemagick's convert util following the guide at official page

I'm using the following command.

convert -background lightblue -pointsize 72 label:" spaces " label.gif

Although my text as leading whitespace, the output image has no space in the front. Spaces are getting trimmed. Trailing spaces have no issue though. I've tried the solution given at this SO question too in vain.

enter image description here

Community
  • 1
  • 1
padfoot
  • 811
  • 7
  • 16

1 Answers1

7

While I had typed this question and was waiting to post it, I figured out a way by guessing ;-)

The solution is simply to escape the first space with blackslash.

convert -background lightblue -pointsize 72 label:"\ spaces " spaces.gif

enter image description here

padfoot
  • 811
  • 7
  • 16