r.composite(1)

πŸ’– r.composite πŸ’–

okay bestie, we're in the GRASS GIS User's Manual and today's main character is r.composite β€” the little icon that smashes red, green and blue rasters together into one gorgeous composite. periodt. πŸŽ€


✨ NAME ✨

r.composite β€” combines red, green and blue raster maps into a single composite raster map. it's giving RGB glow-up. 🌈


πŸ”‘ KEYWORDS πŸ”‘

raster, composite, RGB


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸŽ€ Flags πŸŽ€

  • -d β€” Dither. yes bestie, the Floyd-Steinberg kind, we'll get there πŸ’…
  • -c β€” Use closest color
  • --overwrite β€” Allow output files to overwrite existing files (chaotic but valid)
  • --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=integer β€” Number of levels to be used for each component
    • Options: 1-256
    • Default: 32
  • level_red=integer β€” Number of levels to be used for <red>
    • Options: 1-256
  • level_green=integer β€” Number of levels to be used for <green>
    • Options: 1-256
  • level_blue=integer β€” Number of levels to be used for <blue>
    • Options: 1-256
  • output=name [required] β€” Name for output raster map

πŸ’… DESCRIPTION πŸ’…

so this program takes three raster maps and squishes them into one composite RGB map. iconic behavior honestly.

for every single input map layer, it pulls the matching component straight out of that map's color table β€” like, for the red map it grabs the red component, and so on down the line. it's a whole coordinated outfit moment. πŸ‘‘

and ngl? in general your maps should be using a grey-scale color table. that's the vibe. that's the assignment.


🫢 NOTES 🫢

the default number of intensity levels for each component is 32, which gives you a total of 32768 possible colors β€” that's equivalent to 15 bits per pixel. cute, right?

but bestie, listen. if you go significantly higher than that on the levels? two things happen and neither is fun:

  • r.composite takes longer to run 😭
  • displaying the resulting layer with d.rast also gets significantly slower πŸ’€

Floyd-Steinberg dithering is optionally used with the -d flag. it's optional. it's a choice. it's a lifestyle. ✨


🌟 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: Saturday Jan 17 05:40:44 2026

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


okay that's the whole page, no cap. πŸ’–

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual

this was GRASS 8.4.2 energy the entire time, bestie β€” go make something pretty. πŸ¦‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from