[GRASSLIST:4580] Transparent null values in output images.

I have some rasters with large null areas.

I would like to output these as images (r.out.png or r.out.tiff) with the null
values represented by transparent pixels.

I can't see any flags on these commands to enable this.

Is this possible?

Regards
Gordon
--

Gordon Keith
Programmer/Data Analyst
Marine Acoustics
CSIRO Marine Research
http://www.marine.csiro.au

The Lord has told us what is good.
What he requires of us is this:
  to do what is just,
  to show constant love,
  and to live in humble fellowship with our God.
    -- Micah 6:8

I don't think that transparency (alpha channel?) is available for GRASS yet, though I would love to see it implemented too.

-Ian

On Oct 19, 2004, at 6:10 PM, Gordon Keith wrote:

I have some rasters with large null areas.

I would like to output these as images (r.out.png or r.out.tiff) with the null
values represented by transparent pixels.

I can't see any flags on these commands to enable this.

Is this possible?

Regards
Gordon
--

Gordon Keith
Programmer/Data Analyst
Marine Acoustics
CSIRO Marine Research
http://www.marine.csiro.au

The Lord has told us what is good.
What he requires of us is this:
  to do what is just,
  to show constant love,
  and to live in humble fellowship with our God.
    -- Micah 6:8

Transparency would be particularly nice for exporting vectors. So would anti-aliasing.

Mark

-----
Have fun or die trying - but try not to actually die.
http://www.AboveCalifornia.com
Got Mac OS X? Get the AboveCalifornia Sherlock Channel:
sherlock://www.AboveCalifornia.com/sherlock/SherlockChannel.xml?action=add

On Oct 19, 2004, at 6:20 PM, Ian MacMillan wrote:

I don't think that transparency (alpha channel?) is available for GRASS yet, though I would love to see it implemented too.

-Ian

-----
Have fun or die trying - but try not to actually die.
http://www.AboveCalifornia.com
Got Mac OS X? Get the AboveCalifornia Sherlock Channel:
sherlock://www.AboveCalifornia.com/sherlock/SherlockChannel.xml?action=add

Wanna frag? Add the ..::LVL Sherlock Channel and get the newest Quake3 maps:
sherlock://www.AboveCalifornia.com/sherlock/LVL/SherlockChannel.xml?action=add

On Wed, Oct 20, 2004 at 12:10:30PM +1100, Gordon Keith wrote:

I have some rasters with large null areas.

I would like to output these as images (r.out.png or r.out.tiff) with the null
values represented by transparent pixels.

I can't see any flags on these commands to enable this.

Is this possible?

Not sure but maybe 'r.out.gdal' does that (GRASS 5.7) already?

Markus

I have some rasters with large null areas.

I would like to output these as images (r.out.png or r.out.tiff) with
the null values represented by transparent pixels.

I can't see any flags on these commands to enable this.

Is this possible?

some clues:

set $GRASS_TRANSPARENT to "TRUE"
  then d.out.png (or d.mon start=PNG etc)

Set $GRASS_WIDTH & $GRASS_HEIGHT to region settings for cols & rows to
get 1:1 scaling (as with r.out.png).

d.out.png then merge alpha in the GIMP?
r.out.ppm -> gimp?

see the second half of this email:
  http://article.gmane.org/gmane.comp.gis.grass.devel/4943
  http://freegis.org/cgi-bin/viewcvs.cgi/grass/src/general/g.pnmcomp/

Hamish

some clues:

set $GRASS_TRANSPARENT to "TRUE"
  then d.out.png (or d.mon start=PNG etc)

...

Where can I find a list of all environment variables
with their meaning.

Thanks, Miha

___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

Where can I find a list of all environment variables
with their meaning.

see the "environment variables" help pages:

http://grass.ibiblio.org/gdp/html_grass5/index.html
http://grass.ibiblio.org/grass57/manuals/html57_user/index.html

Hamish

--- Hamish <hamish_nospam@yahoo.com> wrote:

> Where can I find a list of all environment
variables
> with their meaning.

see the "environment variables" help pages:

http://grass.ibiblio.org/gdp/html_grass5/index.html

http://grass.ibiblio.org/grass57/manuals/html57_user/index.html

Hamish

Thanks! It is evident that I do not read the manual
pages enough!

Miha

___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

On Wed, 20 Oct 2004 23:01, Hamish wrote:

> I have some rasters with large null areas.
>
> I would like to output these as images (r.out.png or r.out.tiff) with
> the null values represented by transparent pixels.
>
> I can't see any flags on these commands to enable this.
>
> Is this possible?

some clues:

set $GRASS_TRANSPARENT to "TRUE"
  then d.out.png (or d.mon start=PNG etc)

Set $GRASS_WIDTH & $GRASS_HEIGHT to region settings for cols & rows to
get 1:1 scaling (as with r.out.png).

d.out.png then merge alpha in the GIMP?
r.out.ppm -> gimp?

If I'm going to have to resort to GIMP it's probably easier just to use
r.out.png then GIMP:
Edit - Layers - Add alpha channel
Edit - Select - by colour - click on white
Edit - Cut (Ctrl-X)
File - Save

But it does look like

r.out.ppm raster
pnmtopng -transparent white raster.ppm > raster.png

does the job nicely.

Thanks for pointing me in the right direction.

Thought: is it worth mentioning this in the r.out.ppm man page?

Regards
Gordon

--

Gordon Keith
Programmer/Data Analyst
Marine Acoustics
CSIRO Marine Research
http://www.marine.csiro.au

To mess up a Linux box, you need to work at it;
to mess up your Windows box, you just need to work on it.
- Scott Granneman, SecurityFocus