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

Juergen Ambrosy juergen.ambrosy at ewetel.net
Tue Oct 7 17:08:21 EDT 2003


Hello Mr. Greenwood,

It worked!!! I did exactly as you told, but I used Corel instead of Gimp. 
i saved the geotiff header of each original 24bit-image to textfiles. Then I 
just loaded one tiff, created an optimized 8bit-color palette and saved this 
palette. Now I just had to reduce each tiff from 24 to 8bit using exactly 
this palette.
Now write back the geotiff header to each image, cause it's lost after saving 
with corel. Then import all geotiff with r.in.gdal.
I checked the color palette files in the .../colr directory to be sure  - and 
yes they had all the same values.

Rest was easy: adjust the region - use r.patch with all images and there you 
have a big mosaic!
Fantastic - Thanks a lot!

(I need to invest some time in Gimp, I think reducing images with predefined 
color palette can be done with it too.)

> It has been a year or so since I last used The Gimp, so I can not give you
> exact steps. But there is a good book on The Gimp that you can read online
> at:  http://gimp-savvy.com/BOOK/
>
> The basic idea is to use The Gimp to create a good color palette for your
> images and then apply that palette to all the images before importing them
> into GRASS. Open one representative image and use The Gimp to create a
> palette optimized for that image, and save the palette. Then open each of
> the other images and apply the saved palette to each image.
>
> Gdal can import 24 bit images into GRASS. They will be imported as three
> layers (or "maps") in GRASS e.g. if you were to import "image_a.tif" you
> would have image_a.1, image_a.2, image_a.3 for red, green, and blue
> channels. And then you could use r.patch to patch the red, green, and blue
> channels from your various images together.
>
> Converting your images to a single 8bit palette prior to importing makes
> them smaller and easier to work with in GRASS, but you have the added
> effort of converting the images beforehand.
>
> Good luck,
> Rich
>
>
> Richard W. Greenwood, PLS
> Greenwood Mapping, Inc.
> Rich <at> GreenwoodMap <dot> com
> (307) 733-0203
> http://www.GreenwoodMap.com

-- 
Juergen Ambrosy

juergen.ambrosy at ewetel.net




More information about the grass-user mailing list