[GRASS-user] GRASS export GeoTiff adventure... continued :-)

Glynn Clements glynn at gclements.plus.com
Sun Aug 3 14:32:44 EDT 2008

Nikos Alexandris wrote:

> > > So nodata=255 does not mean "loss of information"?
> > > The red, green, blue channels are 8-bit (2 high 8 = 256, values counting
> > > from 0 up to 255).
> > >   
> > It means that NULL cells in the GRASS raster are replaced with 255 or 
> > the specified nodata value.
> And what happens to the 255 pixels if the NULL cells become 255 after
> export?

Nothing happens to them. You just cannot distinguish between cells
which are 255 and those which are null.

> OK, let me figure this out:
> I have an RGB photo with values from 0 to 255.
> Import in GRASS splits in red, green, blue with values from 0 to 255
> Why should I want to eliminate those 255 values after exporting? This is
> what I mean loss of information.

If you import data which doesn't contain any nulls, then re-export it,
the nodata= option will typically have no effect, as there aren't any
nulls which need to be converted.

OTOH, if the GRASS raster which you are exporting contains values from
0 to 255 inclusive, and also contains nulls, that's 257 possible
values. If the format to which you are exporting only has 256 possible
values (i.e. 0 to 255), then you can't avoid losing information.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list