PerlMagick multiple thumbnail resize

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
wsielski
Posts: 6
Joined: 2016-09-22T03:37:03-07:00
Authentication code: 1151

PerlMagick multiple thumbnail resize

Post 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");
wsielski
Posts: 6
Joined: 2016-09-22T03:37:03-07:00
Authentication code: 1151

Re: PerlMagick multiple thumbnail resize

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PerlMagick multiple thumbnail resize

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply