[Gdal-dev] rgb2pct.py and NO_DATA?

Frank Warmerdam warmerdam at pobox.com
Mon Sep 27 14:47:05 EDT 2004

Ethan Alpert wrote:
> It seems that rgb2pct.py will use my transparent color when it chooses
> the quantized colormap and assign non-transaprent pixels this color
> index. Any suggestions on how to avoid this? I get transparent speckles
> scattered throught my quantized images.


Is your situation that you have a particular value marked as NODATA on
your red, green and blue input bands and that this is being ignored?  If so,
it should be possible to adjust the code for building a PCT to ignore such
pixels, (but to add a transparent color if any are found), and then to change
the DitherRGB2PCT() code to keep track of that.  If this is what you need,
please submit a bug report.  If you are interested in doing it yourself and
submitting patches let me know.

However, it is pretty uncommon for folks to have nodata properly marked on
multispectral input images, so I hadn't thought about this before.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the Gdal-dev mailing list