题
如何可以伸展或使用Perl脚本调整大小(任何格式的)的图像?
解决方案
我推荐图片:: Imlib2 ......如果你可以在机器上安装imlib2
请参阅文档:图片:: Imlib2
use Image::Imlib2;
# load image from file
my $image = Image::Imlib2->load("in.png");
# get some info if you want
my $width = $image->width;
my $height = $image->height;
# scale the image down to $x and $y
# you can set $x or $y to zero and it will maintain aspect ratio
my $image2 = $image->create_scaled_image($x,$y);
# save thumbnail to file
$image2->save("out.png");
您可能也有兴趣在图片:: imlib2 ::缩略图,如果您不能安装imlib2看看的图像:: Magick
其他提示
您可以使用图片::调整。
不隶属于 StackOverflow