Page 1 of 1

PerlMagick multiple thumbnail resize

Posted: 2016-09-22T03:40:46-07:00
by wsielski
Hi,

I'm trying to make a multiple image resize of single file but the problem is when I make thumbnail 48x48 and then bigger eg 100x100 it looks like the thumb wasn't made from original image 1000x1000 but from the first resize. How can I make this using PerlMagick?

Code: Select all

use Image::Magick;
my $x = Image::Magick->new;
$x->Read("image.jpg");

$x->Resize(geometry => '48x48'); # this one if fine, good quality
$x->Write(filename => "image1.jpg");
$x->Resize(geometry => '500x500'); # this one is created from image1.jpg so the quality is poor
$x->Write("image2.jpg");

Re: PerlMagick multiple thumbnail resize

Posted: 2016-09-22T06:13:12-07:00
by wsielski
There is a Clone() method available on Image::Magick object so if we do so we can Clone the object for all resolutions.

Re: PerlMagick multiple thumbnail resize

Posted: 2016-09-22T06:47:44-07:00
by snibgo
Yes. You are resizing an image, then resizing it again. A better result will come from making a clone of the original image and resizing the clone. Then make another clone of the original and resize that, and so on.