Connecting Tech Pros Worldwide Forums | Help | Site Map

ImageCreateFromPNG

rich
Guest
 
Posts: n/a
#1: Jul 17 '05
I'm writing a php script with the gd library. I had everything working
wonderfully, however, all of the sudden, If i import two png's into one
image, the quality of the second png degrades very badly.

If I only use one, it looks fine. If i load one with
ImageCreateFromPNG and reference it twice, it looks fine. It's only
when I use ImageCreateFromPNG twice on two different files, the second
one looks awful. Any suggestions?


Philip Ronan
Guest
 
Posts: n/a
#2: Jul 17 '05

re: ImageCreateFromPNG


rich wrote:
[color=blue]
> I'm writing a php script with the gd library. I had everything working
> wonderfully, however, all of the sudden, If i import two png's into one
> image, the quality of the second png degrades very badly.
>
> If I only use one, it looks fine. If i load one with
> ImageCreateFromPNG and reference it twice, it looks fine. It's only
> when I use ImageCreateFromPNG twice on two different files, the second
> one looks awful. Any suggestions?
>[/color]

You're trying to combine images with different colour tables.

Use imagecreatetruecolor() to make a 24-bit full-colour image, and paste
your PNGs into that.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/


rich
Guest
 
Posts: n/a
#3: Jul 17 '05

re: ImageCreateFromPNG


Excellent! That was it. Thank you much.

Closed Thread