Cyrillic text from the image
Posted: 2012-04-04T03:43:18-07:00
Hi all!
Cyrillic text from the image. My decision.
Cyrillic text from the image. My decision.
Code: Select all
use Encode;
use Image::Magick;
$image = Image::Magick->new;
$image->Set(size=>'250x250');
$image->ReadImage('canvas:red');
$image->Border(width=>1, height=>1, bordercolor=>'black');
$text = 'Текст кириллица';
$text = encode("utf8", decode("cp1251", $text));
$image->Annotate(font=>'arial.ttf', pointsize=>18, fill=>'green', gravity=>'center', text=>$text);
$image->Set (compression=>'JPEG', quality=>80);
$image->Write ("name.jpg");