[FWTools] Color format conversion during warp

Matthew Harmon matt at matthewharmon.com
Mon May 23 13:36:25 EDT 2005


Frank / All:

Thanks a bunch for your previous suggestion.  Of course... it sparked yet
more questions :-)

1. My project is a texture conversion tool for VERY unsophisticated users.
A real "Insert CD - click button - build scenery" type thing.  Thus, I'd
need to build any pre-processing into the app.  I could pre-convert the
entire source image to 8 bit first, but that would require many hundreds of
meg of temporary storage, extra time, etc.  

Are there any other "on-the-fly" methods you recommend I investigate?  

(The relationship between input and output imagery could be one-to-many or
many-to-one... so warping first then converting isn't necessarily a win for
me.)

2. If the warp kernel doesn't support color/band conversion, what is the
behavior when warping between different color/band formats?  Does it just
early-out when it sees a mismatch?

Thanks so much.  GDAL is a life-saver for me and I really appreciate your
dedication to this.

(Also, other than Rush in Rio, can you recommend any live performance
footage?  Is the quality of Chronicles good?)

Matt



Matthew, 

My suggestion is that as a step before warping that you scale
the data to 8bit with gdal_translate. 

eg. 
gdal_translate -scale in.tif out.tif

You can also give explicit scaling values to gdal_translate. 

eg. 
gdal_translate -scale 0 2047 0 255 in.tif out.tif

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

-----Original Message-----
From: Frank Warmerdam [mailto:fwarmerdam at gmail.com] 
Sent: Tuesday, May 10, 2005 4:46 PM
To: Matthew Harmon
Cc: fwtools at lists.maptools.org
Subject: Re: [FWTools] Color format conversion during warp

On 5/10/05, Matthew Harmon <matt at matthewharmon.com> wrote:
> 
> Hi All. sorry if this is better at GDAL. I'm still getting my feet wet. 
> 
> I'm using the fwtools build to reproject some imagery and was wondering if
> the warper also converts color data to the destination format.  I can't
seem
> to get it working properly. 
> 
> I'm taking some GeoTiff with 3 16-bit bands (11bits of "real" data per
band,
> I think) and I want to convert it to 3 8-bit bands for ultimate use as a
> 24bit DirectX texture.  Do I need to manually convert the image after the
> warp, or is there a better way.  I think I have my destination dataset
> properly formatted and prepared. but maybe that's the problem? 







More information about the FWTools mailing list