GRASS logo

NAME

r.composite - Combines red, green and blue raster maps into a composite. Default output: three true-colour FCELL maps (output.r/g/b). Use -p for a legacy palette-indexed CELL map.

KEYWORDS

raster, composite, RGB

SYNOPSIS

r.composite
r.composite --help
r.composite [-pdbcgk] red=name green=name blue=name [levels=string] [level_red=integer] [level_green=integer] [level_blue=integer] output=name [null_value=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-p
Palette mode: produce a single palette-indexed CELL map (legacy behaviour)
-d
Floyd-Steinberg dithering (palette mode)
-b
Bayer ordered dithering (palette mode; parallelisable, no streak artefacts)
-c
Use closest-colour rounding (palette mode)
-g
Gamma-correct quantisation: linearise to linear light before quantising (palette mode)
-k
Oklab perceptual quantisation: uniform palette in Oklab colour space (palette mode; implies linear-light processing)
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

red=name [required]
Name of raster map to be used for <red>
green=name [required]
Name of raster map to be used for <green>
blue=name [required]
Name of raster map to be used for <blue>
levels=string
Number of levels per component for palette mode (1-256 or "auto")
Default: 64
level_red=integer
Number of levels for <red> (palette mode, overrides levels=)
Options: 1-256
level_green=integer
Number of levels for <green> (palette mode, overrides levels=)
Options: 1-256
level_blue=integer
Number of levels for <blue> (palette mode, overrides levels=)
Options: 1-256
output=name [required]
Name for output raster map
null_value=integer
Fill value (0-255) for NULL pixels; if omitted, NULLs are propagated
Options: 0-255

Table of contents

DESCRIPTION

This program combines three raster maps to form a composite RGB map. For each input map layer, the corresponding component from the map's color table is used (e.g. for the red map, the red component is used, and so on). In general, the maps should use a grey-scale color table.

NOTES

The default number of intensity levels for each component is 32, resulting in a total of 32768 possible colors (equivalent to 15 bits per pixel). If significantly more levels than this are used, not only will r.composite take longer to run, but displaying the resulting layer with d.rast will also be significantly slower.

Floyd-Steinberg dithering is optionally used with the -d flag.

EXAMPLES

RGB composite of three satellite bands

Color composite of a LANDSAT scene (North Carolina sample dataset):
g.region raster=lsat7_2002_10
r.composite blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30 \
            output=lsat7_2002_rgb

RGB composite with dithering

Creating a composite RGB raster using 32 color levels per layer, with dithering:
r.composite -d red=elevation.r green=elevation.g blue=elevation.b \
            output=elev.composite

SEE ALSO

d.rast, d.rgb, r.blend, r.colors, r.rgb

Wikipedia Entry: Floyd-Steinberg dithering

AUTHOR

Glynn Clements

SOURCE CODE

Available at: r.composite source code (history)

Accessed: Monday Jul 27 12:28:11 2026


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual