It seems that even though there were replies to my last submission. They did not directly address my issue, so I am reposting here to hope for a specific answer to my question.

Does anyone know how to reduce the image file size using image magick. It seems when I use the Scale method the dimensions are reduced but the file size does not get reduced enough. For instance, a 400k image is only reduced to 160k which is not acceptable for web download. I have tried using the Sample method but do not see any difference when compared to the Scale method. I would like to take a 400k+ image and resample to 35 to 40k. The image is JPG format. Below is a snippet of how I am trying to sample:

$imgfile = "photo.jpg"; $geometry = ($newwidth x $newheight); $im->Sample(geometry => $geometry); $im->Write("JPG:../images/$imgfile");
Thank you for your input.

David K.


In reply to Image Magick - Sample vs. Scale by db2admin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.