[mapserver-users] GD 2.0.1: 24 bit PNG =)

Beau Gunderson bludwulf at crackrock.net
Thu Jul 5 22:47:13 EDT 2001


GD 2.0.1 beta has support for 24 bit color in the PNG format.

When using the new gdImageCreateTrueColor function, the pixels array
becomes invalid and you must use the tpixels array.

Instead of gdImageColorAllocate, you can use either gdImageTrueColor or
gdImageColorResolve, the latter of which is compatible with both palette
and true color images.

Another thing to note is that gdImageColorAllocate doesn't set the
background color for a true color image the first time it's called.

My workaround was to call gdImageFilledRectangle and fill the background
with white manually in msLoadPalette().

My results so far have been discouraging. Mapserver creates all the
images, but black seems to be the only color that works. The legend text
prints out, and the scalebar works as well. Note that they both use only
the color black.

If anyone wants a diff so they can work on it, I'll whip one up.

I'm going to continue fiddling with it. ;)

BTW: If anyone has trouble linking GD 2.0.1 into mapserver on freebsd,
email me for a fix.

GD 2.0.1 is at: http://www.boutell.com/gd/manual2.0.1.html

-Beau Gunderson




More information about the mapserver-users mailing list