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

Poor "scale" results

From: Ask Bjørn Hansen (
18087@xyz.molar.is)
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
            http://tmp.askask.com/2008/02/imager/

    The original file:
            http://tmp.askask.com/2008/02/imager/6-23lHGG_o.jpg

    With stddev 1.25 and scale 1:
            http://tmp.askask.com/2008/02/imager/6-1NPnEW_s.jpg

    stddev 1.8 and scale 0.7:
            http://tmp.askask.com/2008/02/imager/6-1NPnEW_s_18_07.jpg

    stddev 1.1 and scale 0.3:
            http://tmp.askask.com/2008/02/imager/6-1NPnEW_s_1103.jpg

    As a test I scaled the image with Preview.app (too dark, but nice
    detail):
            http://tmp.askask.com/2008/02/imager/6-23lHGG_preview.jpg

    and with photoshop (similar filesize to the Imager files), much more
    detail in the asphalt:
            http://tmp.askask.com/2008/02/imager/6-23lHGG_ps.jpg

    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/
    



  •