[GRASSLIST:1571] i.composite and r.in.gdal

I have finally gotten through the bumps to getting r.in.gdal working on
a geotiff.

Now, I have loaded a shade relief of the US with r.in.gdal and have a
shdrlf image group and shdrlf.1, shdrlf.2 and shdrlf.3 raster images. I
have tried to composite them with i.composite using 1=R, 2=G and 3=B
(assuming this to be the correct sequence) using 16^3 colors (resulting
in 4096 shades). The results are not what I had expected.

Here is what I had expected:
http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/expected.png
and here is what I actually got:
http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/composite.png

Any help on getting this composite right?

Ed Davison

I think you need to set the color palette correctly
before doing the composite. try first ruining r.color
on each image, setting a gray color palette or a
gray.eq and then make the composite

Daniel

--- bfdi533 <bfdi533@cbacc-security3.bus.utexas.edu>
wrote:

I have finally gotten through the bumps to getting
r.in.gdal working on
a geotiff.

Now, I have loaded a shade relief of the US with
r.in.gdal and have a
shdrlf image group and shdrlf.1, shdrlf.2 and
shdrlf.3 raster images. I
have tried to composite them with i.composite using
1=R, 2=G and 3=B
(assuming this to be the correct sequence) using
16^3 colors (resulting
in 4096 shades). The results are not what I had
expected.

Here is what I had expected:

http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/expected.png

and here is what I actually got:

http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/composite.png

Any help on getting this composite right?

Ed Davison

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

Ahhh, good thing I kept notes on this when I did it a while ago..
now, I am thinking this is good, but this is how I did it..

1. Created a color file with values of 0 and 255.. such as:
0 0 0 0
255 255 255 255
end

then, using cat color.file | r.colors map=X.X color=rules

2. run r.support, and ONLY create histogram (option 2)

3. use r.composite to put the three layers together...

4. and to export, r.out.tiff...

Shot in the dark, has been about 1 1/2 yrs since I have done this.. hopefully the notes are still good...

Daniel Victoria wrote:

I think you need to set the color palette correctly
before doing the composite. try first ruining r.color
on each image, setting a gray color palette or a
gray.eq and then make the composite

Daniel

--- bfdi533 <bfdi533@cbacc-security3.bus.utexas.edu>
wrote:

I have finally gotten through the bumps to getting
r.in.gdal working on
a geotiff.

Now, I have loaded a shade relief of the US with
r.in.gdal and have a
shdrlf image group and shdrlf.1, shdrlf.2 and
shdrlf.3 raster images. I
have tried to composite them with i.composite using
1=R, 2=G and 3=B
(assuming this to be the correct sequence) using
16^3 colors (resulting
in 4096 shades). The results are not what I had
expected.

Here is what I had expected:

http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/expected.png

and here is what I actually got:

http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/composite.png

Any help on getting this composite right?

Ed Davison

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

--
LTJG Kevin Slover, NOAA
GIS Specialist/Oceanographer
NOAA/National Hurricane Center/Storm Surge Unit
11691 SW 17th Street
Miami FL 33165

W (305) 229-4456

On Mon, Oct 27, 2003 at 10:58:13AM -0800, Daniel Victoria wrote:

I think you need to set the color palette correctly
before doing the composite. try first ruining r.color
on each image, setting a gray color palette or a
gray.eq and then make the composite

The version in CVS (5.3-cvs) is already updated to apply
a grey color table. Using this version 'd.rgb' et al.
deliver the expected result immediately.

Markus

--- bfdi533 <bfdi533@cbacc-security3.bus.utexas.edu>
wrote:
> I have finally gotten through the bumps to getting
> r.in.gdal working on
> a geotiff.
>
> Now, I have loaded a shade relief of the US with
> r.in.gdal and have a
> shdrlf image group and shdrlf.1, shdrlf.2 and
> shdrlf.3 raster images. I
> have tried to composite them with i.composite using
> 1=R, 2=G and 3=B
> (assuming this to be the correct sequence) using
> 16^3 colors (resulting
> in 4096 shades). The results are not what I had
> expected.
>
> Here is what I had expected:
>
http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/expected.png
> and here is what I actually got:
>
http://w3test.mccombs.utexas.edu/services/cbacc/dbsupport/images/composite.png
>
> Any help on getting this composite right?
>
> Ed Davison
>

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

--
Markus Neteler <neteler@itc.it> http://mpa.itc.it
ITC-irst, Istituto per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy

On Tue, 2003-10-28 at 03:30, Markus Neteler wrote:

On Mon, Oct 27, 2003 at 10:58:13AM -0800, Daniel Victoria wrote:
> I think you need to set the color palette correctly
> before doing the composite. try first ruining r.color
> on each image, setting a gray color palette or a
> gray.eq and then make the composite

The version in CVS (5.3-cvs) is already updated to apply
a grey color table. Using this version 'd.rgb' et al.
deliver the expected result immediately.

Markus

Maybe it is just my misunderstanding of i.composite. I tried d.rgb as
well and it gave the perfect disply. But, as I understand it, this is
not a map that can be output with ps.map as it is 3 different raster
layers that do not overlay as they have all values in each file. Seems
d.rgb is for display only.

I thought that i.composite was to do the same thing but to produce a
combined output raster that should look the same as the output from
d.rgb, something that can be plotted with ps.map.

Have I misunderstood something here?

Ed

Ed Davison wrote:

> > I think you need to set the color palette correctly
> > before doing the composite. try first ruining r.color
> > on each image, setting a gray color palette or a
> > gray.eq and then make the composite
>
> The version in CVS (5.3-cvs) is already updated to apply
> a grey color table. Using this version 'd.rgb' et al.
> deliver the expected result immediately.

Maybe it is just my misunderstanding of i.composite. I tried d.rgb as
well and it gave the perfect disply. But, as I understand it, this is
not a map that can be output with ps.map as it is 3 different raster
layers that do not overlay as they have all values in each file. Seems
d.rgb is for display only.

Recent versions (5.0.0 and later) of ps.map have an "rgb" command,
which is similar to the "raster" command except that it accepts
separate red/green/blue layers.

All of the most important functions which exist for a single raster
have R/G/B equivalents, e.g.:

  function composite R/G/B bands

  import r.in.ppm r.in.ppm -b
  export r.out.ppm r.out.ppm3
  display d.rast d.rgb
  print ps.map/raster ps.map/rgb

I thought that i.composite was to do the same thing but to produce a
combined output raster that should look the same as the output from
d.rgb, something that can be plotted with ps.map.

Note that there is also r.composite, which will create a composite map
from arbitrary maps; it doesn't require the creation of imagery
groups, and can be run non-interactively.

However, as the process of generating a composite map results in
either loss of quality (when using less than 256 levels per component)
or massive colour tables (when using 256 levels per component), it
should be avoided as much as possible (i.e. don't use it if you can
just process the three channels individually).

FWIW, one situation where this currently cannot be avoided is NVIZ,
which doesn't support using separate R/G/B channels as a colour layer;
you have to create a composite map.

--
Glynn Clements <glynn.clements@virgin.net>