The testing codes I have done in ImageMagick are very messy now due to various attempt here and there. I abandon testing it further and currently able to have better luck in PHP using ImageCreateTrueColor, imagealphablending, imagesavealpha, ImageCopyResampled. But still not able to reduce the file size without resizing the dimension for PNG.

Testing in ImageMagick I have done using functions like;

$image->Set(units => 'PixelsPerInch'); $image->Set(depth=>8); $image->Set(density => '300x300'); $image->Set(quality =>'20');

Do take note the codes above are not in actual order.

Resizing is ok with

$image->Resize( geometry => '400x400' ); $image->Extent( geometry => '400x400' );
File size still not very small but that is not my purpose.

Currently I tested using pngquant in Windows commandline, the PNG file are able to compressed a lot and still retain its original dimension.

If you are able to give me some hints on ImageMagick, that would be very much appreciated.

Image files I used are normal wallpaper size in JPG and PNG, most download from google search. Some of the file size about 2-3MB. One PNG is using smartphone model with transparent alpha background to test how is the result after resize (thumbnail).


In reply to Re^2: PNG compression support transparent by hankcoder
in thread PNG compression support transparent by hankcoder

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.