Changing png compression (level) in gdImagePngPtrEx doesn't affect the result...

From: Date: Tue, 07 Oct 2008 21:07:07 +0000
Subject: Changing png compression (level) in gdImagePngPtrEx doesn't affect the result...
Groups: php.gd.devel 
Request: Send a blank email to php-gd-devel+get-478@lists.php.net to get a copy of this message
Hi I am using LibGD from the lisp environment (cl-gd) and I have problems compressing png files when I create a new image by copying a part of original png file. What happens under the lisp wrapper is a sequence of gdImageCopyResampled and gdImagePngPtrEx. If I vary the level variable from 0 to 9 (which is called "compression" in lisp wrapper) the size of resulting png image stays the same. I am wondering if I can do anything to compress the final image? Does it happen because the original png image already compressed and gdImagePngPtrEx can't do any further compression? The size I am getting is around 95K. When I try to trim it using optipng it sheds another 18%. If I convert it to jpg (with 100% quality) the image is around 25K. I am wondering can I compress it to say 50K using gdImagePngPtrEx? I am just trying to optimize it for web and 95K looks a bit bigger than I want for a 400x400 image. The reason I don't want to use jpeg is that when I convert it to jpeg, the red color becomes blotchy even with 100% quality. Any suggestions are welcome! Thank you, Andrew

« previous php.gd.devel (#478) next »