[GRASS-dev] [GRASS GIS] #3130: r.out.gdal: add alpha channel support
GRASS GIS
trac at osgeo.org
Sat Aug 13 11:45:49 PDT 2016
#3130: r.out.gdal: add alpha channel support
--------------------------+---------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: normal | Milestone: 7.2.0
Component: Raster | Version: svn-releasebranch72
Resolution: | Keywords: r.out.gdal
CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Comment (by mmetz):
Replying to [comment:4 neteler]:
> With Sentinel-2, also 0 is used as a data value (eg `Computed
Min/Max=0.000,13668.000`). The black border mask can be retrieved from an
auxiliary JP2000 file and applied as MASK in GRASS GIS. So far so nice.
>
> Still I am not sure if it now better to use `r.rescale` or the `#`
operator of `r.mapcalc` with some formula in order to "free up" the 0
value for paving the way of exporting with alpha as above?
Using a nodata value means that any band values equal to the nodata value
will be interpreted as nodata. Using an alpha channel means that all
pixels with an alpha value of 0 are transparent. The alpha channel thus
represents per-pixel encoding of nodata, just like the GRASS null file.
That means when using an alpha channel, you do not need to "free up" any
particular value, you can use any value you like to replace NULL cells, as
long as the value can be represented by the Byte data type. It does not
matter if that value is already present in any of the input bands.
This is about exporting RGB data, not GIS data, therefore the `#` operator
of `r.mapcalc` needs to be used. The result is a regular image (like a
screenshot) that can be displayed by any simple image viewer coming with
your OS and/or desktop environment. When exporting, do you want to provide
something like a screenshot or the actual data?
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3130#comment:5>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list