(none) imager-devel
/ help / lists / applications / search /

Poor "scale" results

From: Ask Bjørn Hansen (
Date: Fri 22 Feb 2008 - 23:31:17 GMT

  • Next message: William Kern: "Re: Poor "scale" results"

    Hi everyone,

    I'm using Imager to scale basically random pictures (user uploaded
    things) to various small sizes.

    I can never make it look good though! I seem to either have it too
    blurry or too "sharp" -- either way it's losing details.

    I put up some examples at

    The original file:

    With stddev 1.25 and scale 1:

    stddev 1.8 and scale 0.7:

    stddev 1.1 and scale 0.3:

    As a test I scaled the image with Preview.app (too dark, but nice

    and with photoshop (similar filesize to the Imager files), much more
    detail in the asphalt:

    In a blind test my coworkers here preferred the Photoshop version
    (grrh). They tell me to just get over it and use Image-Magick, but
    I've never done that and not regretted having to maintain the
    ImageMagick/PerlMagick installation. :-)

    My code for doing this below -- anything obvious I'm doing wrong?

        - ask

             my $img = $img_original->scale(scalefactor => $scale);

             if ($size->{crop}) {
                 $img = $img->crop(width => $size->{dim}->[0],
                                   height => $size->{dim}->[1],

             $img->filter(type => "unsharpmask", stddev => 1.25, scale => 1)
               or die $img->errstr;

             my $data;
             $img->write(data => \$data,
                         type => 'jpeg',
                         jpegquality => 82,
               or die $img->errstr;

    http://develooper.com/ - http://askask.com/