[Gdal-dev] One band Jpeg with color table

Frank Warmerdam warmerdam at pobox.com
Wed Mar 22 21:29:36 EST 2006


Ivan Lucena wrote:
> Hi There,
> 
> Maybe it's because I am new here, so my questions could be silly.
> 
> But f you have a single band byte image with color table and you want to
> export to a jpeg color result, for visualization purpose only, you need
> to create a RGB version of your image and then convert it to jpeg,
> because jpeg single band are greyscale only
> (http://www.gdal.org/frmt_jpeg.html).
> 
> How to do that in the GDAL C API?

Ivan,

There is no built in support for this operation.  You basically need to do
it for yourself "in code" if you are using the library.  For commandline
purposes there is an existing pct2rgb.py script that can be used.

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    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list