in reply to PNG compression support transparent

I tried with ImageMagick
What did you try? Can you tell us a bit more about the input image, how you are reading it in and how you write out the new one? There are lots of things you can do that aren't in the Perl docs.
  • Comment on Re: PNG compression support transparent

Replies are listed 'Best First'.
Re^2: PNG compression support transparent
by hankcoder (Scribe) on Jul 24, 2015 at 07:03 UTC

    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).