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
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.
manpage says:
convert [input-option] input-file [output-option] output-file
So just add an output file:
convert -font Arial -pointsize 22 -fill black -draw "text 0,0 'TESTTEXT'" test.jpg test-out.jpg
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
上一篇: iOS 7上Web应用程序中的HTTP基本认证失败?
下一篇: 文字图像,不断收到错误“没有图像定义”