Re: [GD-DEVEL] save Grayscale PNG with gd
| From: | Dieter Guthmann | Date: | Mon, 12 Nov 2007 10:40:57 +0000 |
| Subject: | Re: [GD-DEVEL] save Grayscale PNG with gd | ||
| References: | 1 2 | Groups: | php.gd.devel |
| Request: | Send a blank email to php-gd-devel+get-278@lists.php.net to get a copy of this message | ||
Hello Pierre,
Pierre wrote:
On Nov 12, 2007 10:45 AM, Dieter Guthmann <mailing-deg@bup-nbg.de> wrote: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... Rgds., Dieteris it possible to save a GD-created image as grayscale-PNG-File?Not yet, there is already a patch in our issues tracker to read GrayScale PNG image (http://bugs.libgd.org/?do=details&task_id=88) but I did not yet manage to add write support for PNG grayscale images. The plan is to first add a grayscale internal format (8, 16 or 32, with alpha or not) and then allow one to save it as a grayscale image (png, tiff, tga for ex.). Alternatively you can use the grayscale conversion function to convert the image to a faked grayscale image and save it as a rgba PNG. It is not the perfect solution but it is visually correct. Am I right when I guess that the same problem concerns the TIFF or XPM-Format?