[Gdal-dev] pct2rgb.py
Frank Warmerdam
warmerdam at pobox.com
Thu Oct 14 13:51:17 EDT 2004
Dobmeyer, Todd wrote:
> I am trying to take my red, blue, and green geotiff files and turn them
> into one tif file. I assume I need to use pct2rgb.py to do this. I went
> and downloaded python 2.3.4 and loaded up pct2rgb.py. When I tell it to
> RUN, in the shell, it complains that in the file gdal.py it cannot find
> the module named _gdal. Am I not running this correctly in python, or
> why is this not running correctly? Thanks for your help!
Todd,
I'm not sure how you built your GDAL. Was it built with python support
enabled? You also didn't mention what platform you are on. If you are
on windows or Linux you could just use one of the recent OpenEV_FW builds
which include python and with all paths and environment variables setup
properly.
All that said, if you have red, green and blue bands in seperate files
and you want to merge them into a single multi-band file you don't want
pct2rgb.py anyways. pct2rgb.py is for making a 24bit RGB image from an
8 bit image with a color table (pct == pseudo-color table in my lingo).
What you want to do can be accomplished with gdal_merge.py like this:
gdal_merge.py -o rgb.tif red.tif green.tif blue.tif -seperate
The "-seperate" flag indicates that each file should be placed
in a different band. Of course, this is a python script too, so you will
need to resolve your python issues.
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