24 bit to 8 bit gd conversion

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Feb 27 12:13:25 EST 2006


So you're basically talking about a 24-bit GIF or PNG outformat block correct?
Seems like a reasonable idea to me. 

As an aside I also wish we could do auto quantization with a format like PNG that 
supports both 8 and 24-bit pixels. For example, many applications allow you to
set background imagery and in that case you need true color output. However,
you typically need to use the 24-bit format when that imagery is off as well resulting
in uncessarily large files.

Perhaps we might consider a parameter like:

  QUANTITIZE TRUE|FALSE|AUTO

Steve

>>> Yewondwossen Assefa <assefa at DMSOLUTIONS.CA> 02/26/06 2:02 PM >>>
Hi There,

  We were doing few tests last week on the possiblity to do 24 bit 
rendering using png24 and convert the output to 8 bit at the end. The 
main reason being that we had issues with the color limitation on some 
of the maps we were using. And also the fact that antialising was only 
available in 24bits.
  We were experimenting with the gd function 
gdImageCreatePaletteFromTrueColor(img, 0, 256);  to achieve that, 
calling the fucntion just before the save.
  It seems to give decent results, although I think we need to do more 
tests and there seems to be an issue with transparencies.
  The idea was that if It was a good enough, It could make it into 
something like an outputformat option.

  What do you think in general about this issue ?

  Thanks

-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca 
http://www.dmsolutions.ca/ 

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-dev mailing list