identify different for command line versus perl conversion
Posted: 2015-08-21T23:54:02-07:00
I (think I) have successfully rewritten the following convert command with the perl below that. The images appear to be the same when compared in a viewer, but the identify command gives slightly different output between the two. The command line:
And the perl:
The identify output for each:
As you can see the identify output for the perl conversion is slightly different than the desired command line conversion. Even though they appear to render the same in a image viewer.
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?
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?