Opened 6 years ago

Last modified 5 years ago

#3667 new enhancement

Add an option to add grey color scale to r.in.gdal imports

Reported by: pierreroudier Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Display Version: 7.4.1
Keywords: d.rast, default color table Cc:
CPU: All Platform: All

Description

At the moment r.in.gdal automatically affects the viridis colour palette to any raster layer imported.

I think that's a good thing, and for single layer rasters it corresponds to best modern practice.

It is however slightly annoying when importing imagery, and necessitate to loop through the bands with r.colors layer.i col=grey.

I think the best of both worlds could be achieved by adding a flag -g to r.in.gdal that would force the colour palette to be grey.

Thus:

r.in.gdal ./path/to/foo.tif out=foo

would use viridis, while:

r.in.gdal -g ./path/to/bar.tif out=bar

would use grey.

Change History (5)

in reply to:  description comment:1 by mmetz, 6 years ago

Component: DefaultDisplay
CPU: UnspecifiedAll
Keywords: d.rast default color table added
Milestone: 7.8.0
Platform: UnspecifiedAll
Version: unspecified7.4.1

Replying to pierreroudier:

At the moment r.in.gdal automatically affects the viridis colour palette to any raster layer imported.

It is not r.in.gdal but the raster library that assigns viridis, the default color table, if a raster does not have a color table assigned.

I think that's a good thing, and for single layer rasters it corresponds to best modern practice.

It is however slightly annoying when importing imagery, and necessitate to loop through the bands with r.colors layer.i col=grey.

I think the best of both worlds could be achieved by adding a flag -g to r.in.gdal that would force the colour palette to be grey.

r.in.gdal assigns a color table only if color table information is available in the input metadata.

Thus the solution would be to either use grey as default for CELL maps (in the raster library), or specifically assign a color table with r.colors.

Anyway, this is not an issue of r.in.gdal.

comment:2 by neteler, 5 years ago

Milestone: 7.8.07.8.1

Ticket retargeted after milestone closed

comment:3 by neteler, 5 years ago

Milestone: 7.8.17.8.2

Ticket retargeted after milestone closed

comment:4 by neteler, 5 years ago

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:5 by neteler, 5 years ago

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.