I have a PHP application where...
All works well except if the images are PNG-8's. So, I don't know if this is possible, but could I convert a PNG-8 to a PNG-24 (or some other kind of PNG)?
I don't know much about PNG types, but according to http://www.fileformat.info, the metadata of a working image looks like this...
<javax_imageio_png_1.0>
<IHDR width="600" height="764" bitDepth="8" colorType="RGB" compressionMethod="deflate" filterMethod="adaptive" interlaceMethod="none"/>
<pHYs pixelsPerUnitXAxis="7874" pixelsPerUnitYAxis="7874" unitSpecifier="meter"/>
<tIME year="2013" month="4" day="25" hour="14" minute="9" second="17"/>
</javax_imageio_png_1.0>
And metadata from a failing image looks like this...
<javax_imageio_png_1.0>
<IHDR width="600" height="755" bitDepth="8" colorType="Grayscale" compressionMethod="deflate" filterMethod="adaptive" interlaceMethod="none"/>
<pHYs pixelsPerUnitXAxis="7874" pixelsPerUnitYAxis="7874" unitSpecifier="meter"/>
<tIME year="2013" month="4" day="23" hour="21" minute="10" second="33"/>
</javax_imageio_png_1.0>
PNG-8 refers to a PNG image with an indexed palette. It is almost always a smaller filesize, but is limited to 256 colours. PNG-24 is full-colour.
The easiest way to convert a palette image to a full-colour one in PHP is like so:
$src = imagecreatefrompng("my-indexed-image.png");
$dst = imagecreatetruecolor($w=imagesx($src),$h=imagesy($src));
imagecopy($dst,$src,0,0,0,0,$w,$h);
imagedestroy($src);
// now do stuff with $dst