[gdal-dev] grey output from gdal2tiles.py

Klokan Petr Přidal klokan at klokan.cz
Wed May 14 07:47:42 EDT 2008


Hi,

I guess it is because your GeoTIFF is paletted. (result of gdalinfo
will tell us that probably).

If I am right then fast solution will be to run first

pct2rgb.py on your TIFF to convert it to true RGB colors and then run
gdal2tiles.py on the result.

Same problem appear for example with NOAA marine maps, which are also paletted.
Frank, do you think functionality of pct2rgb should be embedded
directly in gdal2tiles? I realized several people have trouble with
that...

Klokan

On Wed, May 14, 2008 at 4:21 AM, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Wendell Turner wrote:
>
> > I used gdal2tiles.py to convert a GeoTIFF file into a
> > directory for use with OpenLayers.  The tiles are generated,
> > and can be viewed with OpenLayers, but the tiles are all
> > gray.  There appears to be some structure to the images, but
> > they do not have any colors, and little detail.
> >
> > The input file looks fine in gtviewer.
> >
> > Is the input to gdal2tiles supposed to be in some other
> > format?  It uses gdal.Open, which I suppose can open any
> > type of file format.  Any suggestions?
> >
>
>  Wendell,
>
>  I don't know what gtviewer is.  Can you make the original file available
>  to review?  I suspect it has a very limited dynamic range and the viewer
>  you are using for it directly does a contrast stretch, but this doesn't
>  happen with the tiles in openlayers. Alternatively, perhaps it doesn't
>  start out as an RGB image as is expected by gdal2tiles.
>
>  So basically, review the input file structure (a gdalinfo report will
>  help) vs. what gdal2tiles expects as input.
>
>  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 OSGeo, http://osgeo.org
>
>
>
>  _______________________________________________
>  gdal-dev mailing list
>  gdal-dev at lists.osgeo.org
>  http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


More information about the gdal-dev mailing list