Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image processing 如何向图像添加输入号码?_Image Processing_Imagemagick - Fatal编程技术网

Image processing 如何向图像添加输入号码?

Image processing 如何向图像添加输入号码?,image-processing,imagemagick,Image Processing,Imagemagick,我想有一个脚本,输入一个数字和一个图像,然后把数字写在图像的一角 然后我将把这个脚本推广到两个输入的列表中 但是,我不知道是否有特定的语言/应用程序来进行这种图像处理。我推荐ImageMagick,它是免费的,安装在大多数Linux发行版上,并且可以很容易地安装在Windows和Mac OSX上。可从下载-。您可以在命令行或PHP/Perl/Ruby和大多数其他语言中使用它 在命令行中,可以执行以下操作: convert input.jpg -gravity southeast \

我想有一个脚本,输入一个数字和一个图像,然后把数字写在图像的一角

然后我将把这个脚本推广到两个输入的列表中


但是,我不知道是否有特定的语言/应用程序来进行这种图像处理。

我推荐ImageMagick,它是免费的,安装在大多数Linux发行版上,并且可以很容易地安装在Windows和Mac OSX上。可从下载-。您可以在命令行或PHP/Perl/Ruby和大多数其他语言中使用它

在命令行中,可以执行以下操作:

convert input.jpg -gravity southeast \
          -stroke '#000C' -strokewidth 2 -annotate 0 'Dail Beagh' \
          -stroke  none   -fill white    -annotate 0 'Dail Beagh' \
          output.jpg

或者这个

convert input.jpg -fill red -undercolor '#00000080' -gravity SouthWest \
        -annotate +0+5 'Dail Beagh' output2.jpg   

或任何数目的其他版本—

如果要编写脚本,可以将以下内容保存在名为
title

#!/bin/bash
image=$1
title=$2

convert "$image" -gravity southeast \
          -stroke '#000C' -strokewidth 2 -annotate 0 "$title" \
          -stroke  none   -fill white    -annotate 0 "$title" \
          output.jpg

convert "$image" -fill red -undercolor '#00000080' -gravity SouthWest \
        -annotate +0+5 "$title" output2.jpg   
然后使用

chmod +x title
然后运行它

./title "input.jpg" "some funky title"
或者如果你特别想要一个号码

./title "some image somewhere.png" 56

或者,假设您有一些现成的数字保存为
GIF
文件,例如

0.gif

9.gif

您可以将它们并排附加以制作如下标签:

convert 9.gif 9.gif 0.gif +append label.gif
为此:

然后用

convert input.jpg -gravity southeast label.gif -composite output.jpg

或者,您可以通过以下方式一次完成:

convert input.jpg -gravity southeast   \
    \( 9.gif 9.gif 0.gif +append \)    \
    -composite output.jpg

我推荐ImageMagick,它是免费的,安装在大多数Linux发行版上,并且可以很容易地安装在Windows和MacOSX上。可从下载-。您可以在命令行或PHP/Perl/Ruby和大多数其他语言中使用它

在命令行中,可以执行以下操作:

convert input.jpg -gravity southeast \
          -stroke '#000C' -strokewidth 2 -annotate 0 'Dail Beagh' \
          -stroke  none   -fill white    -annotate 0 'Dail Beagh' \
          output.jpg

或者这个

convert input.jpg -fill red -undercolor '#00000080' -gravity SouthWest \
        -annotate +0+5 'Dail Beagh' output2.jpg   

或任何数目的其他版本—

如果要编写脚本,可以将以下内容保存在名为
title

#!/bin/bash
image=$1
title=$2

convert "$image" -gravity southeast \
          -stroke '#000C' -strokewidth 2 -annotate 0 "$title" \
          -stroke  none   -fill white    -annotate 0 "$title" \
          output.jpg

convert "$image" -fill red -undercolor '#00000080' -gravity SouthWest \
        -annotate +0+5 "$title" output2.jpg   
然后使用

chmod +x title
然后运行它

./title "input.jpg" "some funky title"
或者如果你特别想要一个号码

./title "some image somewhere.png" 56

或者,假设您有一些现成的数字保存为
GIF
文件,例如

0.gif

9.gif

您可以将它们并排附加以制作如下标签:

convert 9.gif 9.gif 0.gif +append label.gif
为此:

然后用

convert input.jpg -gravity southeast label.gif -composite output.jpg

或者,您可以通过以下方式一次完成:

convert input.jpg -gravity southeast   \
    \( 9.gif 9.gif 0.gif +append \)    \
    -composite output.jpg

我很惊讶一些bash命令可以创建这样的东西!我希望有一天能回来做些测试:)干得好,马克@软呢帽谢谢你。是的,Imagemagick的强大功能总是让我惊讶不已——TIFF、PNG、JPEG、边缘检测、颜色校正、FFT、连接组件分析、动画、PDF、过滤、裁剪、成帧、叠加、alpha合成……-)我很惊讶一些bash命令可以创建这样的东西!我希望有一天能回来做些测试:)干得好,马克@软呢帽谢谢你。是的,Imagemagick的强大功能总是让我惊讶不已——TIFF、PNG、JPEG、边缘检测、颜色校正、FFT、连接组件分析、动画、PDF、过滤、裁剪、成帧、叠加、alpha合成……-)