【问题标题】:Text to Image, keep getting error "no images defined"文本到图像,不断收到错误“未定义图像”
【发布时间】:2013-09-24 09:52:46
【问题描述】:

出于测试目的,我正在使用 imagemagick(最实际的便携式 Windows 版本)将文本转换为图像。所以我输入以下内容:

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

但我不断收到此错误:

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

谁能告诉我为什么?

问候

【问题讨论】:

    标签: image text imagemagick


    【解决方案1】:

    尝试添加一个画布并使用-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 我还添加了-gravity center 以使输出图像中的文本居中

    【讨论】:

      【解决方案2】:

      我遇到这个问题是因为我的系统上同时安装了 32 位和 64 位版本的 ImageMagick。删除后者解决了它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-08-23
        • 2016-08-16
        • 1970-01-01
        • 1970-01-01
        • 2020-03-09
        • 2019-05-15
        • 2021-03-10
        • 1970-01-01
        相关资源
        最近更新 更多