[Gdal-dev] Reducing GeoTIFF color depth from 24 bit to 8 bit

Frank Warmerdam warmerdam at pobox.com
Wed Aug 22 18:25:42 EDT 2007


Rich Signell wrote:
> GDAL folk,
> 
> Is is possible to use GDAL to reduce the color depth of a GeoTIFF from
> 24 to 8 bit?
> 
> I've looked at doc and e-mail archives for 20 minutes and haven't
> found it yet - hoping someone can spend 30 seconds on the answer!
> 
> My work around is to reduce the colordepth in Irfanview, but then I
> need to add the georeferencing info back in again with gdal_translate.
>  This works, but there must be an easier way.   This is all because
> our ship's navigation software (HYPACK) doesn't seem to like 24 bit
> GeoTIFF, but 8 bit is fine.

Rich,

The rgb2pct.py python script (available in FWTools builds for instance)
can be used to convert 24bit images to paletted 8bit images.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list