Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have just started trying to use ImageMagik and hope to use Perl::Magik. My current issue is trying to figure out how to go from using the ImageMagik command line tool "convert" to using the Perl::Magik functions. Specifically, I can do the following using the "convert" command line tool:
convert original.jpg -strip -density 72x72 -resample 72x72 -filter Lanczos -resize 200x200 cnv002.jpg
and the result looks as good as rescaling the same image using Gimp. If I try to do the same things using Perl::Magik the result is very blurry. What "default" values is "convert" using? The blurry Perl code I have been trying is:
$IM = Image::Magick->new;
$IM->Read($original) &&
die __LINE__ . ": Could not do initial read on $original: $!";
$IM->Strip;
$IM->Set(units => 'PixelsPerInch');
$IM->Set(quality => 100);
$IM->Resample(geometry => "72x72",
filter => 'Lanczos');
$IM->Resize(geometry => $fileSizes->{'hn'}->{width} ."x".
$fileSizes->{'hn'}->{height},
filter => 'Lanczos');
$tmp = "$dir/hn.jpg";
$IM->Write(filename=>$tmp,
compression=>'None') &&
die __LINE__ . ": Could not write to $tmp: $!";
I have tried a few other combinations and permutations of functions and settings but I can not duplicat ther command line results. Ideas? Pointers?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ImageMagik & Perl::Magik, defaults?
by gam3 (Curate) on Apr 25, 2011 at 20:11 UTC | |
by seven.reeds (Initiate) on Apr 25, 2011 at 20:49 UTC | |
|
Re: ImageMagik & Perl::Magik, defaults?
by Anonymous Monk on Apr 26, 2011 at 03:20 UTC | |
|
Re: ImageMagik & Perl::Magik, defaults?
by zentara (Cardinal) on Apr 26, 2011 at 14:25 UTC |