[Gdal-dev] pct2rgb.py

Ethan Alpert ealpert at digitalglobe.com
Thu Oct 14 14:02:15 EDT 2004


You'll also need pynumeric installed to run the pct2rgb.py and
rgb2pct.py functions. This required a fortran compiler too.

-e

-----Original Message-----
From: gdal-dev-bounces at xserve.flids.com
[mailto:gdal-dev-bounces at xserve.flids.com] On Behalf Of Dobmeyer, Todd
Sent: Thursday, October 14, 2004 11:59 AM
To: Frank Warmerdam
Cc: gdal-dev at xserve.flids.com
Subject: RE: [Gdal-dev] pct2rgb.py


I honestly do not remember how I built gdal, if I did it with python
support or not. I might rebuild this to make sure that I do add python
support. I am on Windows XP Pro and am very new to gdal yet. To make
sure I get python support, I should go out and find one of the OpenEV_FW
builds? Or what exactly should I do? Thanks for your continued help and
I am glad I chose to work with gdal!

Todd Dobmeyer

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Thursday, October 14, 2004 1:51 PM
To: Dobmeyer, Todd
Cc: gdal-dev at xserve.flids.com
Subject: Re: [Gdal-dev] pct2rgb.py

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

_______________________________________________
Gdal-dev mailing list
Gdal-dev at xserve.flids.com
http://xserve.flids.com/mailman/listinfo/gdal-dev



More information about the Gdal-dev mailing list