4 use Test::More tests => 4;
5 use Imager::Test qw(is_image);
7 -d "testout" or mkdir "testout";
9 Imager->open_log(log => "testout/filters-autolev.log");
11 my $base = Imager->new(xsize => 10, ysize => 10);
12 $base->box(filled => 1, xmax => 4, color => "404040");
13 $base->box(filled => 1, xmin => 5, color => "C0C0C0");
16 my $cmp = Imager->new(xsize => 10, ysize => 10);
17 $cmp->box(filled => 1, xmax => 4, color => "#000");
18 $cmp->box(filled => 1, xmin => 5, color => "#FFF");
21 my $work = $base->copy;
22 #$work->write(file => "testout/autolevel-base.ppm");
23 ok($work->filter(type => "autolevels"), "default autolevels");
24 #$work->write(file => "testout/autolevel-filtered.ppm");
25 #$cmp->write(file => "testout/autolevel-cmp.ppm");
26 is_image($work, $cmp, "check we got expected image");
30 my $work = $base->to_rgb_double;
31 ok($work->filter(type => "autolevels"), "default autolevels (double)");
32 is_image($work, $cmp, "check we got expected image");
33 $work->write(file => "testout/autolevel-filtered.ppm", pnm_write_wide_data => 1);