Code: Select all
convert in.jpg -resize 250x250^ -gravity center -crop 250x250+0+0 +repage -quality 100 out.png
Code: Select all
my $image = Image::Magick->new;
$image->Read( $file );
$image->Set(quality => 100 );
$image->Set(page =>'0x0+0+0' );
$image->Resize( geometry => sprintf '%dx%d^', $width, $height );
$image->Crop( gravity => 'Center', geometry => sprintf '%dx%d+0+0', $width, $height );
$image->Write('out.png');
Code: Select all
out.cmd.png PNG 250x250 250x250+0+0 8-bit sRGB 107KB 0.000u 0:00.000
out.perl.png PNG 250x250 370x250+60+0 8-bit sRGB 107KB 0.000u 0:00.000
Is this "good enough" for web images? Any advice for what needs to change in the perl program to get the perl output to identify the same as the command line output?