note 106093 added to function.imagepng
| From: | matteosistisette at gmail dot com | Date: | Sun, 09 Oct 2011 19:02:15 +0000 |
| Subject: | note 106093 added to function.imagepng | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183757@lists.php.net to get a copy of this message | ||
The name "quality" for the compression parameter is quite misleading, as png compression
is always lossless. The trade off is between speed and filesize, it cannot affect quality.
Here's something I found at stackoverflow; I haven't checked it, but if it is correct it
should definitely included in the documentation:
---
from php source (gd.h):
/* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all,
* 1 is FASTEST but produces larger files, 9 provides the best
* compression (smallest files) but takes a long time to compress, and
* -1 selects the default compiled into the zlib library.
*/
Conclusion: Based on the Zlib manual (http://www.zlib.net/manual.html) the default compression level
is set to 6.
---
Regarding suggestions to rescale the 0-99 quality range of jpeg into the 0-9 range of png, note that
for jpeg 99 is minimum compression (maximum quality) while for png 9 is maximum compression (quality
doesn't change).
----
Server IP: 130.206.1.5
Probable Submitter: 80.58.205.96 (proxied: 88.20.71.86)
----
Manual Page -- http://www.php.net/manual/en/function.imagepng.php
Edit -- https://master.php.net/note/edit/106093
Del: integrated -- https://master.php.net/note/delete/106093/integrated
Del: useless -- https://master.php.net/note/delete/106093/useless
Del: bad code -- https://master.php.net/note/delete/106093/bad+code
Del: spam -- https://master.php.net/note/delete/106093/spam
Del: non-english -- https://master.php.net/note/delete/106093/non-english
Del: in docs -- https://master.php.net/note/delete/106093/in+docs
Del: other reasons-- https://master.php.net/note/delete/106093
Reject -- https://master.php.net/note/reject/106093
Search -- https://master.php.net/manage/user-notes.php