Geotiff List: Tool to convert 8-bit gray to RGBA using a custom color table?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Geotiff List: Tool to convert 8-bit gray to RGBA using a custom color table?

Jeff Bullard-2
GeoTIFF list,

I have weather data that is represented as an 8-bit GeoTIFF with one band (grayscale).  I would like to use a color table to convert into RGBA for map display.

Are there any existing tools to do this?  I use a linux platform with FWTools for most of my work.

Previously I used Mapserver and a mapfile to render single-band raster into a color map.  Now I'm trying Google Earth API to display the same maps.  I'm new at KML and have found no way to use KML to do simple color mapping that my current mapfiles perform, which is to render the grayscale into 6 shades of blue.  I'm hoping to use some GDAL utility to convert the grayscale GeoTIFFs into RGBA using a color table stored in a file.  I haven't found a way to do it.

My other alternative is to write some code in C using libtiff and/or libpng to perform the color operations.  Before I get into that I want to ask the list f there is a simple way to do it using existing tools.  

Thanks,
Jeff Bullard



_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: Geotiff List: Tool to convert 8-bit gray to RGBA using a custom color table?

Chris 'Xenon' Hanson
Jeff Bullard wrote:

> GeoTIFF list,
> I have weather data that is represented as an 8-bit GeoTIFF with one
> band (grayscale).  I would like to use a color table to convert into
> RGBA for map display.
> Are there any existing tools to do this?  I use a linux platform with
> FWTools for most of my work.
> Previously I used Mapserver and a mapfile to render single-band raster
> into a color map.  Now I'm trying Google Earth API to display the same
> maps.  I'm new at KML and have found no way to use KML to do simple
> color mapping that my current mapfiles perform, which is to render the
> grayscale into 6 shades of blue.  I'm hoping to use some GDAL utility to
> convert the grayscale GeoTIFFs into RGBA using a color table stored in a
> file.  I haven't found a way to do it.
> My other alternative is to write some code in C using libtiff and/or
> libpng to perform the color operations.  Before I get into that I want
> to ask the list f there is a simple way to do it using existing tools.  

  I don't think KML can do it. You might be able to do it with a combination of netpbm
(which I think can colorize a greyscale) and fwtools (to capture the metadata before
netpbm and reinsert it afterward).

> Thanks,
> Jeff Bullard


--
     Chris 'Xenon' Hanson | Xenon @ 3D Nature | http://www.3DNature.com/
 "I set the wheels in motion, turn up all the machines, activate the programs,
  and run behind the scenes. I set the clouds in motion, turn up light and sound,
  activate the window, and watch the world go 'round." -Prime Mover, Rush.
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: Geotiff List: Tool to convert 8-bit gray to RGBA using a custom color table?

Jeff Bullard-2
Thanks for the reply.  I wrote a short C program using libpng to accomplish the task.  The projection information was lost but that's OK since all my images are EPSG 4326 (lat/long WGS84) as required for Google Earth KML.  Extent information was preserved in the final png image which was a surprise.

Too bad KML doesn't support this because it would allow the user to change the color table on-the-fly to get better contrast in some weather features.




From: Chris 'Xenon' Hanson <[hidden email]>
To: Jeff Bullard <[hidden email]>; "[hidden email] >> GeoTIFF Mailing List" <[hidden email]>
Sent: Sunday, February 15, 2009 12:04:49 PM
Subject: Re: [Geotiff] Geotiff List: Tool to convert 8-bit gray to RGBA using a custom color table?

Jeff Bullard wrote:

> GeoTIFF list,
> I have weather data that is represented as an 8-bit GeoTIFF with one
> band (grayscale).  I would like to use a color table to convert into
> RGBA for map display.
> Are there any existing tools to do this?  I use a linux platform with
> FWTools for most of my work.
> Previously I used Mapserver and a mapfile to render single-band raster
> into a color map.  Now I'm trying Google Earth API to display the same
> maps.  I'm new at KML and have found no way to use KML to do simple
> color mapping that my current mapfiles perform, which is to render the
> grayscale into 6 shades of blue.  I'm hoping to use some GDAL utility to
> convert the grayscale GeoTIFFs into RGBA using a color table stored in a
> file.  I haven't found a way to do it.
> My other alternative is to write some code in C using libtiff and/or
> libpng to perform the color operations.  Before I get into that I want
> to ask the list f there is a simple way to do it using existing tools. 

  I don't think KML can do it. You might be able to do it with a combination of netpbm
(which I think can colorize a greyscale) and fwtools (to capture the metadata before
netpbm and reinsert it afterward).

> Thanks,
> Jeff Bullard


--
    Chris 'Xenon' Hanson | Xenon @ 3D Nature | http://www.3DNature.com/
"I set the wheels in motion, turn up all the machines, activate the programs,
  and run behind the scenes. I set the clouds in motion, turn up light and sound,
  activate the window, and watch the world go 'round." -Prime Mover, Rush.


_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff