Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text to Image, keep getting error "no images defined"

for testing purposes, i am using imagemagick (the most actual portable windows version) to get a text to an 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?

Greetings

like image 453
xola Avatar asked Sep 24 '13 09:09

xola


2 Answers

Try adding a canvas and specifying a 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 output image

like image 94
Andrea Avatar answered Oct 06 '22 19:10

Andrea


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

like image 32
bluish Avatar answered Oct 06 '22 18:10

bluish