add new comparison method rgb_difference that resembles arithmetical difference per...
[imager.git] / bench / scale.perl
CommitLineData
47344604
TC
1#!perl -w
2use strict;
3use Imager;
4
5print "$0\n";
6my @allfiles = (@ARGV) x 120;
7my $srcdir = '.';
8
a10945af
TC
9my %opts1 = (scalefactor=>.333334, qtype => 'mixing');
10my %opts2 = (scalefactor=>.25, qtype => 'mixing');
47344604
TC
11my %exopts=();
12for my $file (@allfiles) {
13 # print STDERR "reading $srcdir/$file\n";
14 my $img=Imager->new();
15 $img->read(file=>"$srcdir/$file") or die "error on \"$srcdir/$file\":
16".$img->{ERRSTR}."\n";
17 # print STDERR "making med_res_imager/$file\n";
18 my $scale=$img->scale(%opts1) or die "error on scale: ".$img->{ERRSTR};
19 $scale->write(file=>"med_res_imager/$file",%exopts);
20 # print STDERR "making icon_imager/$file\n";
21 my $scale2=$scale->scale(%opts2);
22 $scale2->write(file=>"icon_imager/$file",%exopts);
23}