[GRASS5] Re: [GRASSLIST:10403] Transparency added

Hi,

It is great!

Thanks a lot!

Martin

2006/2/19, Huidae Cho <grass4u@gmail.com>:

I've added transparency feature to display drivers (XDRIVER and PNG) and d.rast
and d.vect now have transparency= (%) option. You can find a screenshot
attached in which two rasters and one vector are overlaid.

# opaque drawing
d.rast dem
# 80% transparency, -o is needed not to clip previous drawings
d.rast landuse trans=80 -o
# 90% transparency with blue area fill
d.vect subbasins trans=90 fcolor=blue

Please find attached the png file.

I hope you enjoy this.
Huidae Cho

Martin Landa wrote:

> I've added transparency feature to display drivers (XDRIVER and PNG) and d.rast
> and d.vect now have transparency= (%) option. You can find a screenshot
> attached in which two rasters and one vector are overlaid.

It is great!

It might look that way from the users' perspective.

From the perspective of someone who is in the middle of trying to fix
the display area (i.e. me), it's a disaster.

I'll be removing those changes shortly. If you want translucency, wait
for Michael to add it to gis.m.

--
Glynn Clements <glynn@gclements.plus.com>

Glynn Clements wrote:

If you want translucency, wait for Michael to add it to gis.m.

FWIW, I've added an opacity= option to g.pnmcomp. This eliminates the
need to manually scale the PGM (mask) files.

--
Glynn Clements <glynn@gclements.plus.com>

On Sun, Feb 19, 2006 at 01:28:51PM +0000, Glynn Clements wrote:

Martin Landa wrote:

> > I've added transparency feature to display drivers (XDRIVER and PNG) and d.rast
> > and d.vect now have transparency= (%) option. You can find a screenshot
> > attached in which two rasters and one vector are overlaid.
>
> It is great!

It might look that way from the users' perspective.

>From the perspective of someone who is in the middle of trying to fix
the display area (i.e. me), it's a disaster.

Could you be more specific about that if it was really ill-considered? :wink: Are
we going to have translucency after your work in XDRIVER monitors not only in
tcl/tk gui?

I'll be removing those changes shortly. If you want translucency, wait
for Michael to add it to gis.m.

Does this have something to do with g.pnmcomp to which you've added opacity=?
Actually, I have no idea how g.pnmcomp works, so it would be great if you add
more detail explanation and examples to description.html.

Huidae Cho

Huidae Cho wrote:

> > > I've added transparency feature to display drivers (XDRIVER and PNG) and d.rast
> > > and d.vect now have transparency= (%) option. You can find a screenshot
> > > attached in which two rasters and one vector are overlaid.
> >
> > It is great!
>
> It might look that way from the users' perspective.
>
> From the perspective of someone who is in the middle of trying to fix
> the display area (i.e. me), it's a disaster.

Could you be more specific about that if it was really
ill-considered? :wink:

There are three issues here:

1. I've just started a major clean-up of the display architecture, and
this is entirely the wrong time to be adding significant new
functionality.

2. The ultimate goal of the clean-up will include elimination of
monitors altogether. XDRIVER will only survive for so long as there
remain tasks which can't be performed without it. That's likely to
take a while, but not forever.

3. Even if that functionality was to be added, I can probably think of
around a half-dozen better ways of implementing it. Getting around the
limitations of X by plotting individual pixels isn't a sane solution
(I've only just got rid of the old FreeType rendering code, which did
something similar).

Are we going to have translucency after your work in XDRIVER
monitors not only in tcl/tk gui?

XDRIVER is currently being cleaned up in preparation for being killed
off altogether. The future of the display architecture is for
libraster (and thus d.* programs) to generate graphic files for use by
the GUI.

The current display architecture arose from trying to port a system
designed for graphics terminals (e.g. Tektronix 4105) to X11 with the
minimum of work, and is now well past its "use-by" date; actually it
was probably past its use-by date twenty years ago.

> I'll be removing those changes shortly. If you want translucency, wait
> for Michael to add it to gis.m.

Does this have something to do with g.pnmcomp to which you've added opacity=?

Yes.

Actually, I have no idea how g.pnmcomp works, so it would be great if you add
more detail explanation and examples to description.html.

g.pnmcomp isn't meant for end users. It's an internal tool for use by
a Tcl/Tk GUI.

In essence, g.pnmcomp generates a PPM image by overlaying a series of
PPM/PGM pairs (PPM = RGB image, PGM = alpha channel).

The intention is that d.* programs will emit PPM/PGM pairs (by way of
the PNG-driver code being integrated into libraster). The GUI will
manage a set of layers; each layer consists of the data necessary to
generate a PPM/PGM pair.

Whenever the layer "stack" changes (by adding, removing, hiding,
showing or re-ordering layers), the GUI will render any layers for
which it doesn't already have the PPM/PGM pair, then re-run g.pnmcomp
to generate the final image (just redoing the composition is a lot
faster than redrawing everything).

A C/C++ GUI would either have g.pnmcomp's functionality (image
composition) built-in, or would use the system's graphics API to
perform composition (for translucent layers, you would need OpenGL or
the Render extension, or something else which supports translucent
rendering).

Tk doesn't support transparent (masked) true-colour images (it does
support transparent GIFs, but that's limited to 256 colours), and an
image composition routine in Tcl would be unacceptably slow, hence
the existence of g.pnmcomp.

--
Glynn Clements <glynn@gclements.plus.com>

If you want translucency, wait for Michael to add it to gis.m.

or for users who just can't wait, use the QGIS GRASS plugin. Load
multiple GRASS raster maps, set the transparency slider on the top map's
settings page (right click on name), and Bob's your uncle. The
screenshot on the qgis.org homepage is a good example of this in action.
spearfish dem+land use too.. mind the segfaults?

XDRIVER is currently being cleaned up in preparation for being killed
off altogether. The future of the display architecture is for
libraster (and thus d.* programs) to generate graphic files for use by
the GUI.

I hope that there will continue to be a simple and fast widget-free "GUI"
window which can be controlled from the command line?

Hamish

Hamish,

What do you mean in the wish below? Just trying to understand users' UI
needs.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Hamish <hamish_nospam@yahoo.com>
Date: Wed, 1 Mar 2006 22:24:02 +1300
To: Glynn Clements <glynn@gclements.plus.com>
Cc: <grass4u@gmail.com>, <landa.martin@gmail.com>, <GRASSLIST@baylor.edu>,
<grass5@grass.itc.it>
Subject: Re: [GRASSLIST:10416] Re: [GRASS5] Re: Transparency added

XDRIVER is currently being cleaned up in preparation for being killed
off altogether. The future of the display architecture is for
libraster (and thus d.* programs) to generate graphic files for use by
the GUI.

I hope that there will continue to be a simple and fast widget-free "GUI"
window which can be controlled from the command line?

Hamish

I second Hamish that there should be GUI free monitors like XDRIVER.
Otherwise, the only way to work with the new display architecture is through
GUI, which means we cannot control display from the command line. For example,
with ArcGIS, we have only GUI, but with ArcInfo (AML version), we have both CLI
(command line interface) and GUI. One problem with GUI is scriptability.
Personally, I use the mouse for tasks that I cannot do easily only with the
keyboard. For this reason, I prefer to use d.m with the command line, but it
looks like I cannot do this with gis.m (?).

Huidae Cho

On Wed, Mar 01, 2006 at 09:48:33AM -0700, Michael Barton wrote:

Hamish,

What do you mean in the wish below? Just trying to understand users' UI
needs.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

> From: Hamish <hamish_nospam@yahoo.com>
> Date: Wed, 1 Mar 2006 22:24:02 +1300
> To: Glynn Clements <glynn@gclements.plus.com>
> Cc: <grass4u@gmail.com>, <landa.martin@gmail.com>, <GRASSLIST@baylor.edu>,
> <grass5@grass.itc.it>
> Subject: Re: [GRASSLIST:10416] Re: [GRASS5] Re: Transparency added
>
>> XDRIVER is currently being cleaned up in preparation for being killed
>> off altogether. The future of the display architecture is for
>> libraster (and thus d.* programs) to generate graphic files for use by
>> the GUI.
>
> I hope that there will continue to be a simple and fast widget-free "GUI"
> window which can be controlled from the command line?
>
>
> Hamish

Actually, the direction that Glynn is heading seems to be toward making
GRASS more scriptable than it is now.

For example, if all d.* commmands output to a png file, without needing to
run a visualization driver like d.mon, with your choice of resolution and
size, and with a compositer like g.pnmcomp, you can write a script that
creates a complex, multilayered GIS file and outputs it to a high resolution
PNG.

For interactive CLI work, without any GUI, you could do the same thing and
view the PNG in GIMP--updating the viewed image whenever you make a change.
This seems much more flexible than being forced to only view graphic output
in an xdisplay.

Michael

______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Huidae Cho <grass4u@gmail.com>
Date: Wed, 1 Mar 2006 11:25:21 -0600
To: Michael Barton <michael.barton@asu.edu>
Cc: Hamish <hamish_nospam@yahoo.com>, Glynn Clements
<glynn@gclements.plus.com>, <landa.martin@gmail.com>, Multiple recipients of
list <GRASSLIST@baylor.edu>, <grass5@grass.itc.it>
Subject: Re: [GRASSLIST:10416] Re: [GRASS5] Re: Transparency added

I second Hamish that there should be GUI free monitors like XDRIVER.
Otherwise, the only way to work with the new display architecture is through
GUI, which means we cannot control display from the command line. For
example,
with ArcGIS, we have only GUI, but with ArcInfo (AML version), we have both
CLI
(command line interface) and GUI. One problem with GUI is scriptability.
Personally, I use the mouse for tasks that I cannot do easily only with the
keyboard. For this reason, I prefer to use d.m with the command line, but it
looks like I cannot do this with gis.m (?).

Huidae Cho

On Wed, Mar 01, 2006 at 09:48:33AM -0700, Michael Barton wrote:

Hamish,

What do you mean in the wish below? Just trying to understand users' UI
needs.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Hamish <hamish_nospam@yahoo.com>
Date: Wed, 1 Mar 2006 22:24:02 +1300
To: Glynn Clements <glynn@gclements.plus.com>
Cc: <grass4u@gmail.com>, <landa.martin@gmail.com>, <GRASSLIST@baylor.edu>,
<grass5@grass.itc.it>
Subject: Re: [GRASSLIST:10416] Re: [GRASS5] Re: Transparency added

XDRIVER is currently being cleaned up in preparation for being killed
off altogether. The future of the display architecture is for
libraster (and thus d.* programs) to generate graphic files for use by
the GUI.

I hope that there will continue to be a simple and fast widget-free "GUI"
window which can be controlled from the command line?

Hamish

Hamish wrote:

> XDRIVER is currently being cleaned up in preparation for being killed
> off altogether. The future of the display architecture is for
> libraster (and thus d.* programs) to generate graphic files for use by
> the GUI.

I hope that there will continue to be a simple and fast widget-free "GUI"
window which can be controlled from the command line?

It depends upon what you mean by "GUI".

There will probably still be a facility to pop up a window to view a
map (although it may just be a script which generates a PNG/PPM image
then runs a user-defined viewer program to display it). Similar
support for other non-interactive graphical programs (e.g.
d.histogram) wouldn't be too hard.

More advanced usage such as being able to update the display (e.g.
overlay another map) or anything which requires mouse interaction is
likely to only be available from the full GUI (gis.m or a successor).
However, it's quite possible that the GUI will acquire "server"
functionality (i.e. the ability to control it using external commands)
at some point.

--
Glynn Clements <glynn@gclements.plus.com>

Running a separate graphics software only to view displayed maps is too much.
I got your point but I think GRASS should be standalone. If there will be no
display drivers, could you make gis.m interact with the command line so that
the user can use gis.m as a display driver? I know Hamish didn't mean this by
"widget-free GUI window".

On Wed, Mar 01, 2006 at 10:41:16AM -0700, Michael Barton wrote:

Actually, the direction that Glynn is heading seems to be toward making
GRASS more scriptable than it is now.

For example, if all d.* commmands output to a png file, without needing to
run a visualization driver like d.mon, with your choice of resolution and
size, and with a compositer like g.pnmcomp, you can write a script that
creates a complex, multilayered GIS file and outputs it to a high resolution
PNG.

For interactive CLI work, without any GUI, you could do the same thing and
view the PNG in GIMP--updating the viewed image whenever you make a change.
This seems much more flexible than being forced to only view graphic output
in an xdisplay.

However, the user should not be forced to use GUI :-).

Huidae Cho

Michael

______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

> From: Huidae Cho <grass4u@gmail.com>
> Date: Wed, 1 Mar 2006 11:25:21 -0600
> To: Michael Barton <michael.barton@asu.edu>
> Cc: Hamish <hamish_nospam@yahoo.com>, Glynn Clements
> <glynn@gclements.plus.com>, <landa.martin@gmail.com>, Multiple recipients of
> list <GRASSLIST@baylor.edu>, <grass5@grass.itc.it>
> Subject: Re: [GRASSLIST:10416] Re: [GRASS5] Re: Transparency added
>
> I second Hamish that there should be GUI free monitors like XDRIVER.
> Otherwise, the only way to work with the new display architecture is through
> GUI, which means we cannot control display from the command line. For
> example,
> with ArcGIS, we have only GUI, but with ArcInfo (AML version), we have both
> CLI
> (command line interface) and GUI. One problem with GUI is scriptability.
> Personally, I use the mouse for tasks that I cannot do easily only with the
> keyboard. For this reason, I prefer to use d.m with the command line, but it
> looks like I cannot do this with gis.m (?).
>
> Huidae Cho
>
>
> On Wed, Mar 01, 2006 at 09:48:33AM -0700, Michael Barton wrote:
>> Hamish,
>>
>> What do you mean in the wish below? Just trying to understand users' UI
>> needs.
>>
>> Michael
>> __________________________________________
>> Michael Barton, Professor of Anthropology
>> School of Human Evolution and Social Change
>> Arizona State University
>> Tempe, AZ 85287-2402
>>
>> phone: 480-965-6213
>> fax: 480-965-7671
>> www: http://www.public.asu.edu/~cmbarton
>>
>>
>>
>>> From: Hamish <hamish_nospam@yahoo.com>
>>> Date: Wed, 1 Mar 2006 22:24:02 +1300
>>> To: Glynn Clements <glynn@gclements.plus.com>
>>> Cc: <grass4u@gmail.com>, <landa.martin@gmail.com>, <GRASSLIST@baylor.edu>,
>>> <grass5@grass.itc.it>
>>> Subject: Re: [GRASSLIST:10416] Re: [GRASS5] Re: Transparency added
>>>
>>>> XDRIVER is currently being cleaned up in preparation for being killed
>>>> off altogether. The future of the display architecture is for
>>>> libraster (and thus d.* programs) to generate graphic files for use by
>>>> the GUI.
>>>
>>> I hope that there will continue to be a simple and fast widget-free "GUI"
>>> window which can be controlled from the command line?
>>>
>>>
>>> Hamish
>>

>> XDRIVER is currently being cleaned up in preparation for being
>> killed off altogether. The future of the display architecture is
>> for libraster (and thus d.* programs) to generate graphic files for
>> use by the GUI.
>
> I hope that there will continue to be a simple and fast widget-free
> "GUI" window which can be controlled from the command line?
>
What do you mean in the wish below? Just trying to understand users'
UI needs.

All I want is a switch to turn off the buttons bar at the top and the
coordinates under the cursor info bar at the bottom so I can maximize my
screen real-estate while I work. d.erase, d.rast, d.zoom etc should
still work from the command line. It doesn't have to be part of gis.m or
anything fancy, I'm happiest with a simple window like 'd.mon x0' gives.
I understand that d.zoom will be a problem. Hot keys could be used ('z'
switches cursor to zoom crosshairs, e.g.)
This is not a request, just a wish.

Hamish

OK. Thanks for the clarification. This might have to be something done in a
system beyond TclTk.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Hamish <hamish_nospam@yahoo.com>
Date: Thu, 2 Mar 2006 14:12:50 +1300
To: Michael Barton <michael.barton@asu.edu>
Cc: <grass5@grass.itc.it>
Subject: Re: [GRASSLIST:10656] Re: [GRASS5] Re: Transparency added

XDRIVER is currently being cleaned up in preparation for being
killed off altogether. The future of the display architecture is
for libraster (and thus d.* programs) to generate graphic files for
use by the GUI.

I hope that there will continue to be a simple and fast widget-free
"GUI" window which can be controlled from the command line?

What do you mean in the wish below? Just trying to understand users'
UI needs.

All I want is a switch to turn off the buttons bar at the top and the
coordinates under the cursor info bar at the bottom so I can maximize my
screen real-estate while I work. d.erase, d.rast, d.zoom etc should
still work from the command line. It doesn't have to be part of gis.m or
anything fancy, I'm happiest with a simple window like 'd.mon x0' gives.
I understand that d.zoom will be a problem. Hot keys could be used ('z'
switches cursor to zoom crosshairs, e.g.)
This is not a request, just a wish.

Hamish

Huidae Cho wrote:

Running a separate graphics software only to view displayed maps is too much.
I got your point but I think GRASS should be standalone.

If necessary, a simple X11 PPM viewer can be added easily enough.

Once the display architecture is reworked to the point that d.*
commands simply generate PPM files, it would be trivial to add an
option such that all such files are shown using a viewer by default.

I'm mainly interested in getting rid of the notion of a persistent
monitor process. For a GUI application, it's preferable to just be
able to run a command which generates a graphic file, without having
to "manage" persistent processes.

If there will be no
display drivers, could you make gis.m interact with the command line so that
the user can use gis.m as a display driver? I know Hamish didn't mean this by
"widget-free GUI window".

It would be fairly straightforward to add "server" functionality to
gis.m. By which, I mean something to send commands to gis.m from a
shell, similar to how "mozilla -remote <command>" works. But there
doesn't seem much point in doing this whilst gis.m is in a relatively
unstable state.

--
Glynn Clements <glynn@gclements.plus.com>

In any case, mouse placement is top of the list for removal from the
display architecture. The intention is for the GUI to handle the
placement and to just pass the position (and optionally dimensions) on
the command-line.

This may be obvious, but I would strongly advocate for forking/releasing
GRASS 6.2 before disabling any long standing functionality.

Hamish