以下のようにAnnotateメソッドで可能です。
--------【Perl】--------
use Image::Magick;
...
my $image = Image::Magick->new;
$image->Read($input_file); もと画像の読み込み
$image->Annotate(
font => "/usr/share/fonts/japanese/TrueType/sazanami-gothic.ttf", # フォントファイル
pointsize => 20, # フォントサイズ
fill => "white", # 文字の色
text => "suz-lab", # のせる文字列
x => 0, # 文字の位置(x座標)
y => 20 # 文字の位置(y座標)
);
$image->Write($output_file); # 文字がのった画像の書き出し
...
--------
日本語は未検証です...
--------
http://www.suz-lab.com

0 コメント:
コメントを投稿