Answer the question
In order to leave comments, you need to log in
How to speed up image resizing in perl?
There is a perl script that doubles the size of images in a folder. Now I'm using the ImageMagick module. Pictures sized 1024x768 are rotated for 8 seconds. With a large number of files, this is very long. Is there a way to speed this up?
my ($w, $h) = imgsize($filename);
my $img = new Image::Magick;
my $r = $img->Read($filename); # 0.5 сек
my ($w2, $h2) = ($w * 2, $h * 2);
$r = $img->Resize(width => $w2, height => $h2, filter => 'Lanczos'); # 5 сек
$img->Write($new_filename); # 2.5 сек
Answer the question
In order to leave comments, you need to log in
Try experimenting with MAGICK_THREAD_LIMIT;
For example:
BEGIN { $ENV{MAGICK_THREAD_LIMIT} = 2; }
Try image scaling with epeg library binding :
perl-users.jp/articles/advent-calendar/2010/english/22
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question