[gdal-dev] Re: storing height information in a .tif rather the grayscale in the tif relying on another file

anotherObject ytrapaet at hotmail.com
Tue Feb 23 13:03:31 EST 2010


Hi Frank

>Ytrapaet,
>
>If you had a 16bit DEM with no color information (such as a normal DTED
>for instance) the following command would convert to 8bit by linear scaling
>of the min/max to 0-255 without applying any color table.  The implicit
>color interpretation of the result is greyscale.
>
>   gdal_translate -scale -ot Byte in.dt1 out.tif
>
>I'm not positive what you did, or what you started with since you didn't
>explain. 

Sorry for not being clearer: I started off with a a 32bit tif - however, im
not sure how I can tell if it has an associated color table. Are there both
types of tifs? if so how can I convert from one to the other?

What I do know is that when the 32bit elevation model is viewed through
ArcGIS, its default setting was on "standard deviation stretch". If I change
it to "none", it gives the correct elevation values. However, this seems to
only be a display setting; when I converted the 32 to 8bit using
gdal_translate (which is the same as your example), the resulting 8bit image
did not have any stretching when I viewed it in ArcGIS. However,the
conversion did produce my8bit.tif along with my8bit.aux.xml.

Normally, when i open images in photoshop, i only plan to loose the
georeferencing information, however, it seems that when i open my8bit.tif, i
also loose the proper colors. I think this is because the color information
is stored in the .aux.xml file, but I dont know how to produce a .tif that
is any different (that does not have a .aux.xml file)

> Note that raw DEM data has no inherent coloring so it doesn't really mean
> anything to say "so that the actual .tif grayscale colors are not
> stretched
> at all" in this context. 

I tryed converting my 8bit.tif to 8bit.raw, then back to an 8 bit.tif, but i
still always end up with a .aux.xml file even with the .raw route. In other
words, any method I try, I always end up with an image that is correctly
seen my GIS programs, but incorrectly seen by photoshop. I need the correct
grayscale in photoshop so that I can interactively make new RGB color
gradients that use the elevation informaiton. I am definitely missing a
concept somewhere along the way... The way I see it, its the .aux.xml file
about color that I want embedded into the .tif instead. Is this what is
meant by "applying a color table"? 

thanks for helping out
-- 
View this message in context: http://n2.nabble.com/storing-height-information-in-a-tif-rather-the-grayscale-in-the-tif-relying-on-another-file-tp4617873p4620664.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list