2014-10-13 2 views

답변

3

명령 줄에서이 작업을 수행 할 수 있습니다

convert input.jpg -resize 3x\! output.jpg 

!는 크기 조정을 강제하고, 높이를 비워두면 영향을받지을 떠난다.

# Create it 50x50 and check 
convert -size 50x50 xc:black a.jpg 
identify a.jpg 
a.jpg JPEG 50x50 50x50+0+0 8-bit Gray 256c 173B 0.000u 0:00.009 

# Resize and check 
convert a.jpg -resize 3x\! out.jpg 
identify out.jpg 
out.jpg JPEG 3x50 3x50+0+0 8-bit Gray 256c 162B 0.000u 0:00.000 

그리고 비슷한 일의 펄 버전 :

#!/usr/bin/perl 
use strict; 
use warnings; 
use Image::Magick; 
my $image; 

$image=Image::Magick->new(size=>'500x500'); 
$image->Read('xc:white'); 
$image->write("out1.jpg"); 
$image->Resize(geometry => "3x!"); 
$image->write("out2.jpg"); 
관련 문제