Perl을 사용하여 이미지를 스트레칭, 크기 조정 또는 썸네일
-
20-08-2019 - |
문제
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");
당신은 또한 관심이있을 수 있습니다 image :: imlib2 :: 썸네일, Imlib2를 설치할 수없는 경우 이미지 :: magick
다른 팁
당신은 사용할 수 있습니다 이미지 :: 크기를 조정하십시오.
제휴하지 않습니다 StackOverflow