Text to image, keep getting the "no image" error

for testing, I use imagemagick (the most current version of portable windows) to get text for the image. so I type the following:

convert -font Arial -pointsize 22 -fill black -draw "text 0,0 'TESTTEXT'" test.jpg 

but I keep getting this error:

 convert.exe: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3127. 

Can someone tell me why?

Hi

+7
text image imagemagick
source share
3 answers

Try adding canvas and specifying the size with -size 200x100 xc:#ff0000

 convert -size 200x100 xc:#ff0000 \ -font Arial -pointsize 22 \ -fill black -gravity center \ -draw "text 0,0 'TESTTEXT'" test.jpg 

PS I also added -gravity center to center the text inside the output image

+1
source share

I had this problem because the 32-bit and 64-bit versions of ImageMagick were installed on my system. Removing the latter allowed it.

+1
source share

manpage says:

 convert [input-option] input-file [output-option] output-file 

So just add the output file:

 convert -font Arial -pointsize 22 -fill black -draw "text 0,0 'TESTTEXT'" test.jpg test-out.jpg 
+1
source share

All Articles