Curious problem with r.patch. I'm patching two topo maps and which ever one is identified second will appear blurred on the new composite image (see patch1). However, if I display them independently on the same monitor, both maps are just fine (see display1). It looks like a resolution problem, but the resolution is constant (10m) in the regions used for the original and patched maps.
Maps were purchased as scanned tif images and georeferenced using the lat/long coordinates at the corners (converted to UTM). The same coordinates were then used to create a vector 'frame' that was converted to a mask in order to trim off the edges. Any help with cleaning up the patched map would be appreciated.
On Sat, 6 May 2006 10:24:03 -0400
Stuart Edwards <sedwards2@cinci.rr.com> wrote:
Hi
Curious problem with r.patch. I'm patching two topo maps and which
ever one is identified second will appear blurred on the new
composite image (see patch1). However, if I display them
independently on the same monitor, both maps are just fine (see
display1). It looks like a resolution problem,
The problem is palette. Your images have indexed palettes (8 bit?), each
palette is different. You would need to:
1. move your maps to a truecolor space
2. patch
3. transform back to indexed (to reduce the size and for Grass display
sake, which is slow on more than 15 bit color).
Maybe do it this way:
1. separate each maps R,G,B component with r.mapcalc # operator:
'map_blue=b#map'
2. r.patch R, G and B layers separately
3. r.composite them
Maciek
--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich! http://katalog.panoramainternetu.pl/
Your proposed process cleared up the fuzziness nicely but there were some unintended consequences. The r.composite image had >32,000 new 'colors'. I used i.group and i.cluster to sample the data back to something reasonable. 255 was an improvement, but still too hard to match a color table. Using 4 categories (the original map was printed in blue, brown and black on white) was a big improvement, but the brown and blue were indistinguishable. Long story short, I went back to a graphics program to patch the two sheets and then reimported them. Simple really. Lesson learned is that patching scanned color graphics is better accomplished in something other than GRASS as a pre-process!
Stuart
_________________
On May 7, 2006, at 4:48 AM, Maciek Sieczka wrote:
On Sat, 6 May 2006 10:24:03 -0400
Stuart Edwards <sedwards2@cinci.rr.com> wrote:
Hi
Curious problem with r.patch. I'm patching two topo maps and which
ever one is identified second will appear blurred on the new
composite image (see patch1). However, if I display them
independently on the same monitor, both maps are just fine (see
display1). It looks like a resolution problem,
The problem is palette. Your images have indexed palettes (8 bit?), each
palette is different. You would need to:
1. move your maps to a truecolor space
2. patch
3. transform back to indexed (to reduce the size and for Grass display
sake, which is slow on more than 15 bit color).
Maybe do it this way:
1. separate each maps R,G,B component with r.mapcalc # operator:
'map_blue=b#map'
2. r.patch R, G and B layers separately
3. r.composite them
Maciek
--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich! http://katalog.panoramainternetu.pl/
Your proposed process cleared up the fuzziness nicely but there were
some unintended consequences. The r.composite image had >32,000 new
'colors'. I used i.group and i.cluster to sample the data back to
something reasonable. 255 was an improvement, but still too hard to
match a color table. Using 4 categories (the original map was
printed in blue, brown and black on white) was a big improvement, but
the brown and blue were indistinguishable. Long story short, I went
back to a graphics program to patch the two sheets and then
reimported them. Simple really. Lesson learned is that patching
scanned color graphics is better accomplished in something other than
GRASS as a pre-process!
An alternative approach would have been to start by using a graphics
package to give all the source images the same colour palette.
> An alternative approach would have been to start by using a graphics
> package to give all the source images the same colour palette.
Could you explain how to do it or point to a good source?
In GIMP (2.2.11):
1. Image -> Mode -> RGB
2. Image -> Mode -> Indexed ...
3.
a) choose "Use custom palette" option
b) select a palette
c) uncheck "Remove unused colors from final palette"
d) select a dithering mode appropriate to the data (if you want to
preserve contiguous regions, use None)
4. click OK
Repeat for each image, using the same palette for each.
If none of the standard palettes are suitable, before converting the
first image to RGB, do:
1. Dialogs -> Palettes
2. Right click in the palette dialog
3. Import palette ...
4. choose Image
5. click Import
For command-line usage, use ImageMagick's "convert" program with the
-map and +map options.