0
Image::Magick

system("convert $imageurl $new");
system("convert $new -geometry 480x360 -blur .8 -quality 100 $new");

system("convert $imageurl $new");
system("convert $new -resize 480x360 -blur .8 -quality 100 $new");

上述两种方法都可以正常工作,但是我看不到几何和调整大小之间的明显差异。阅读它,在我的头上,它的工作原理,我会在这里学习。

对于注释,以下工作正常:

my $image;
my $test_text="testies123"; 
$image=Image::Magick->new;
my $x=$image->Read(filename=>"$new");
$x=$image->Annotate(text=>"$test_text",font=>'Candice.ttf',fill=>'#5BADFF',pointsize=>'14',gravity=>'SouthEast', x=>5, y=>5);
$x=$image->Write(filename=>'new_file.jpg'); undef $image;

(上面示例中的 $vars 显然是之前声明的。)

我正在尝试做的是将所有这些组合成一个较短的例程。

喜欢:

system("convert $new -geometry 480x360 -blur .8 -quality 100 -annotate -text testies123 -font Candice -fill blue -pointsize 14  -gravity SouthEast -x 5 -y 5 $new");

我已经尝试了上述的几种变体,也只是尝试通过 system() 进行注释,但是我无法弄清楚这一点。

也许还有更好的方法?提前感谢您教这只老狗另一个技巧。

4

1 回答 1

1

您可以阅读文档以清除-annotate选项http://www.imagemagick.org/script/command-line-options.php#annotate的参数

system("convert $new -geometry 480x360 -blur .8 -quality 100 -font Candice -fill blue -pointsize 14  -gravity SouthEast -annotate +5+5 testies123 $new")
于 2011-03-16T08:11:31.590 回答