Page 1 of 1
GD Library only 256 collors?
Posted: Sun Sep 28, 2003 9:02 pm
by Pineriver
Hi, I posted a while back that I was having some trouble with copying a PNG to a JPEG, and I heard that when using the GD library it converts images to to 256 collors, losing some of the quality. I am wondering is there a formula or a way to work around this so it will not lose any of the quality?
Posted: Mon Sep 29, 2003 12:11 am
by volka
afaik that depends on your version of libgd and the image-resources.
with gd2, imagecopyresampled and truecolor png/jpeg images I cannot see any color and/or quality loss
Posted: Mon Sep 29, 2003 12:14 am
by Pineriver
hmm, maybe its the rong GD version I have, where dose it tell the info about that in phpinfo() ?
Posted: Mon Sep 29, 2003 12:27 am
by volka
gd
GD Support enabled
GD Version bundled (2.0.15 compatible)
right after "ftp" and before "gettext"

Posted: Mon Sep 29, 2003 3:35 am
by pootergeist
1.6.2 was restricted to a 256 indices palette in most functions
1.8.4 could preserve the palette in imagecreatefrom... calls though was still restricted to 256 colours when using imagecreate
versions of 2.0.0 and above can process truecolour with the imagecreatetruecolor and imagecopyresampled combo along with imagecreatefromjpeg and partially imagecreatefrompng
versionss 2.0.4 and 2.0.9 (if I remember rightly) fixed a few glitches in reading png images.
gif though is restricted to 256 indices no matter what.
Posted: Mon Sep 29, 2003 9:33 am
by Pineriver
TY all of you!
