Re: [GD-DEVEL] save Grayscale PNG with gd
[email protected] (Pierre)
| Newsgroups | php.gd.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Dieter, On Nov 12, 2007 11:40 AM, Dieter Guthmann <[email protected]> wrote: > Am I right when I guess that the same problem concerns the TIFF or > XPM-Format? It is nearly the same issue with PNG except when you use a palette based image. However it will be slow as you have to first convert to grayscale and then convert the image to a palette image. > My original problem is that I need a high-resolution-image in a relative > small file in PNM/PGM or XPM-File-Format (PNM is very big when it stores > color-images)... > When I use the pngtopnm-converter of the netpbm-package to convert from > png to pgm/pnm then netpbm creates a (big-sized) pnm-image when the > source is in color or it creates a (relativley small-sized) pgm-image > when the source-file is in grayscale... I can come with a patch later this week or during the weekend. Adding an option to force libpng to write a grayscale image is relatively easy. Or you may try yourself if you feel motivated enough, contributions are always welcome :) Best, --Pierre