Re: [PHP] GD createpng and getting different png formats

2004-05-15 Thread Galen
Sam, File size totally depends on what you're working with. For text and graphics, PNG is significantly smaller than JPEGs that have quality settings anywhere near close to looking similar. For other things, it's tricky. Certainly, reducing the number of colors is a good way to cut file size.

Re: [PHP] GD createpng and getting different png formats

2004-05-14 Thread Sam Joseph
Hi Galen, Thanks for that - all sorted now. I had looked at imagetruecolortopalette, but had not taken it on board. I'm now using it as follows to get a balance between image quality and file size (for png output): imagetruecolortopalette ( $myImage, true, 64); It's just remarkable how much

Re: [PHP] GD createpng and getting different png formats

2004-05-14 Thread Galen
Sam, OK, sorry, I only had a few moments before. Let's see if this points you in the right direction. Basically, you can have "standard" 8-bit images ("color") and then "true" color images (24 bit). When you "create" the GD image resource, you use a function to do that. One such function is

Re: [PHP] GD createpng and getting different png formats

2004-05-14 Thread Sam Joseph
Hi Galen, Many thanks for your reply. I tried to find things in the php manual relating to bit depth, but I didn't find anything relevant: http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&oe=UTF-8&q=site:www%2Ephp%2Enet+bit+depth I haven't read every single one of the image fun

Re: [PHP] GD createpng and getting different png formats

2004-05-14 Thread Galen
IIRC, the goal of PNG is lossless output and it outputs that exactly with PHP. What you send is what you get out. When you're using GD, I suggest you make an 8 bit GD image resource, then make that into PNG. There are several functions dealing with converting bit depth and such, poke around the