Re: No output using caption
Posted: 2011-09-19T20:31:30-07:00
why do you have -rotate 0 in the command line. It is not needed and in fact, I believe doing any rotate before creating the text image may or may not be a problem. If you want to rotate the image, do it after you create the text image. If you are trying to slant the text, then use -annotate.
see http://www.imagemagick.org/Usage/text/ and in particular http://www.imagemagick.org/Usage/text/#annotate
Furthermore you have another rotate 0 later in your command and it does not have the minus sign before it (-rotate 0 not rotate 0).
Please explain why you have the -rotate in your command and what you are trying to do? Do you expect the text to be rotated before you create the image. If so, I don't believe that caption: is sensitive to any pre-rotation.
Also sizes cannot be fractional pixels (-size 39.9x should be -size 40x).
Also I don't think you can preprocess the image to do a -resample before creating the text, though IM may be forgiving about that also.
Also hex values properly should be enclosed in quotes. see http://www.imagemagick.org/script/color.php
Also your -pointsize is way too big for your -size 40x. That is likely causing your problem and IM does not know how to handle the contradiction gracefully. Or the otherway around, your -size 40x is too small for your pointsize. This works if you make your size at least 50. Note the order of the parameters, though the order of the font characteristics before the caption: is not critical. But for proper IM 6 syntax, I believe that the -density, -resample and -rotate should follow caption:. IM is pretty forgiving about most parameter ordering, but that may change under IM 7. (see http://www.imagemagick.org/Usage/basics/#cmdline)
This works:
convert -size 50x -background none -font Arial -pointsize 72 -fill "#000000" -gravity west caption:"A" -density 300 -resample 150 text.png
However, the pointsize is going to be reduced so as to fit the 50 width. It is just to narrow to support your character at 72 points.
If you want to rotate the image after creating the text image, then
convert -size 50x -background none -font Arial -pointsize 72 -fill "#000000" -gravity west caption:"A" -rotate X -density 300 -resample 150 text.png
Furthermore, if you have only one character (or it will fit in one line), you are better off using label: and no pointsize. Then the image will find the correct pointsize to maximize the space.
try this
convert -size 50x -background none -font Arial -fill "#000000" -gravity west label:"A" -density 300 -resample 150 text2.png
IM might be a bit more graceful about the situation, though you are asking it to do two different things that it cannot handle together. You can have one or the other.
I will leave your "hang" problem to the IM developers to sort out with you.
see http://www.imagemagick.org/Usage/text/ and in particular http://www.imagemagick.org/Usage/text/#annotate
Furthermore you have another rotate 0 later in your command and it does not have the minus sign before it (-rotate 0 not rotate 0).
Please explain why you have the -rotate in your command and what you are trying to do? Do you expect the text to be rotated before you create the image. If so, I don't believe that caption: is sensitive to any pre-rotation.
Also sizes cannot be fractional pixels (-size 39.9x should be -size 40x).
Also I don't think you can preprocess the image to do a -resample before creating the text, though IM may be forgiving about that also.
Also hex values properly should be enclosed in quotes. see http://www.imagemagick.org/script/color.php
Also your -pointsize is way too big for your -size 40x. That is likely causing your problem and IM does not know how to handle the contradiction gracefully. Or the otherway around, your -size 40x is too small for your pointsize. This works if you make your size at least 50. Note the order of the parameters, though the order of the font characteristics before the caption: is not critical. But for proper IM 6 syntax, I believe that the -density, -resample and -rotate should follow caption:. IM is pretty forgiving about most parameter ordering, but that may change under IM 7. (see http://www.imagemagick.org/Usage/basics/#cmdline)
This works:
convert -size 50x -background none -font Arial -pointsize 72 -fill "#000000" -gravity west caption:"A" -density 300 -resample 150 text.png
However, the pointsize is going to be reduced so as to fit the 50 width. It is just to narrow to support your character at 72 points.
If you want to rotate the image after creating the text image, then
convert -size 50x -background none -font Arial -pointsize 72 -fill "#000000" -gravity west caption:"A" -rotate X -density 300 -resample 150 text.png
Furthermore, if you have only one character (or it will fit in one line), you are better off using label: and no pointsize. Then the image will find the correct pointsize to maximize the space.
try this
convert -size 50x -background none -font Arial -fill "#000000" -gravity west label:"A" -density 300 -resample 150 text2.png
IM might be a bit more graceful about the situation, though you are asking it to do two different things that it cannot handle together. You can have one or the other.
I will leave your "hang" problem to the IM developers to sort out with you.