I've noticed a couple of things with the ImageCreateFromPng function that
may be useful if your having problems.
1st thing I noticed is
that the PNG file you are creating from needs to be indexed and less than
256 colors.
Secondly, you need to reduce the color depth by 1
for each color you plan on generating in php... I.E. if you plan on
drawing 50 different colors on the screen with php you need to allocate
space for them by reducing the origional image's color depth to 205 colors
(I was pulling my hair out on this one for a while because the wrong colors
were showing up in the output).
Also, if you are saving the
image as a PNG you need to allocate the 1st color as white.. The reason for
this is that Internet Explorer seems to interpret the first color in an
indexed PNG as white no matter what color it is... (Figured this out when
all my pretty black text was turning up as white in I.E. and was normal in
Netscape; allocated the first color in the image as white and the problem
went away.)
-- hope this helps.
imagecreatefromjpeg
