[GRASSLIST:1403] Re: r.patch geotiff-mosaic wrong color problem

Richard Greenwood Rich at GreenwoodMap.com
Sat Oct 4 10:14:02 EDT 2003


At 12:42 PM 10/4/2003 +0200, you wrote:

>Hello,
>
>I'm very new to Grass GIS and have just compiled 5.0.2 and installed it
>succesfully on Suse Linux 8.1.
>Now I'm trying to merge several Geotiff 8-bit images into one mosaic, but I
>have problems with r.patch. The output shows only one image - first one -
>with correct colors - the others are totally scrambled. Just overlaying one
>by another it shows that the import with r.in.gdal was ok.
>I found that Mr. Neteler had some problems with r.patch, too. But if I use 
>his
>script i.image.mosaic (which uses r.mapcalc to patch the images) I get no
>color output - although I set the map region big enough.

An 8bit tiff uses a color palette. The value of any given pixel is used to 
lookup the red,green,blue value in a table. The table is the palette, and 
is a part of the tif file. It is likely that each of tiff's has a different 
palette. The color table for each image is in the colr directory of your 
location. They are just ASCII files.

You can preprocess each image with Gimp or Photoshop so that they all have 
the same color palette before you import them into GRASS, or you can 
convert them to 24bit tiffs before importing. In a 24bit tiff each pixel 
has 3 bytes, one each for red, green, and blue, so no color palette is used.

Rich



Richard W. Greenwood, PLS
Greenwood Mapping, Inc.
Rich <at> GreenwoodMap <dot> com
(307) 733-0203
http://www.GreenwoodMap.com 


More information about the grass-user mailing list