in reply to Gzip content-encoding and PerlMagick

Not sure why you need gzip, it is possible to use ImageMagick's own compression methods (None, BZip, Fax, Group4, JPEG, JPEG2000, LosslessJPEG, LZW, RLE, Zip) I think. Code below is (not exactly) what I use in GD::SecurityImage:
$image->Set( magick => 'png' ); $image->Set( compression => 'Zip' ); print $image->ImageToBlob;

Replies are listed 'Best First'.
Re^2: Gzip content-encoding and PerlMagick
by cowgirl (Acolyte) on Aug 13, 2008 at 19:59 UTC
    Thanks, you're completely right. Much easier to let PerlMagick do it self. I know this is subjective, but what's the best compression to use for JPEG images, esp map images? I already reduced the amount of colours to 256. Is JPEG2000 > JPEG? BZip, Fax, Group4, JPEG, JPEG2000, LosslessJPEG, LZW, RLE, Zip I know for GIF only LZW can be used, correct?
      From Wikipedia's entry for JPEG 2000:
      As of 2008, JPEG 2000 is not widely supported in web browsers...
      JPEG is designed for photographs, so it's appropriate to use if your map has many color gradations, such as a relief map.

      If you have a street map with lines and regions of constant solid color, GIF or PNG is likely better due to the lossless compression. Over-compressed JPEGs of this type of image look poor due to the artifacts from the lossy compression.