Support reading 16-bit grayscale PNGs with full fidelity
The documentation below indicates that libgd does not support 16-bit grayscale or 48-bit colored PNGs. We would like to use 16-bit PNGs on our website, and we would like to draw colored overlays on top of the 16-bit PNGs, probably making them 48-bit PNGs. Will libgd ever support this? Can you offer an alternative solution? Thanks!
gdImageCreateFromPng(FILE in) (FUNCTION) gdImageCreateFromPngPtr(int size, void data) (FUNCTION) gdImageCreateFromPngCtx( gdIOCtx *in) (FUNCTION) gdImageCreateFromPng is called to load images from PNG format files. Invoke gdImageCreateFromPng with an already opened pointer to a file containing the desired image. gdImageCreateFromPng returns a gdImagePtr to the new image, or NULL if unable to load the image (most often because the file is corrupt or does not contain a PNG image). gdImageCreateFromPng does not close the file. You can inspect the sx and sy members of the image to determine its size. The image must eventually be destroyed using gdImageDestroy(). If you already have the image file in memory, pass the size of the file and a pointer to the file's data to gdImageCreateFromPngPtr, which is otherwise identical to gdImageCreateFromPng. If the PNG image being loaded is a truecolor image, the resulting gdImagePtr will refer to a truecolor image. If the PNG image being loaded is a palette or grayscale image, the resulting gdImagePtr will refer to a palette image. gd retains only 8 bits of resolution for each of the red, green and blue channels, and only 7 bits of resolution for the alpha channel. The former restriction affects only a handful of very rare 48-bit color and 16-bit grayscale PNG images. The second restriction affects all semitransparent PNG images, but the difference is essentially invisible to the eye. 7 bits of alpha channel resolution is, in practice, quite a lot.