Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: PNG compression support transparent

by hankcoder (Scribe)
on Jul 24, 2015 at 07:03 UTC ( [id://1136123]=note: print w/replies, xml ) Need Help??


in reply to Re: PNG compression support transparent
in thread PNG compression support transparent

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1136123]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-26 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found