r.composite(1grass)

πŸ’… r.composite β€” the GRASS manual, but make it cute

okay bestie, so this is r.composite from the GRASS User's Manual, and it's literally the glow-up tool for your rasters πŸ’–


✨ NAME ✨

r.composite β€” takes a red raster, a green raster and a blue raster and smooshes them into ONE single composite raster map. it's giving RGB serve 🌈

🏷️ 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 🫧
  • -c β€” Use closest color 🎯
  • --overwrite β€” lets your output files overwrite files that already exist (permission to be messy, granted ✨)
  • --help β€” prints the usage summary πŸ“–
  • --verbose β€” verbose module output (it will yap, and we love that πŸ’¬)
  • --quiet β€” quiet module output 🀫
  • --ui β€” force launching the 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 the output raster map πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so the whole vibe here? this program combines three raster maps into one composite RGB map. for every input map layer, it takes the matching component out of that map's color table β€” like, for the red map it grabs the red component, and so on and so forth, iykyk 🎨

ngl, in general your maps should be using a grey-scale color table. that's the move πŸ’…


πŸ“ NOTES πŸ“

the default number of intensity levels for each component is 32, which gets you a total of 32768 possible colors (that's equivalent to 15 bits per pixel, no cap πŸ”₯).

but listen β€” if you use significantly more levels than that, two things happen:

  • r.composite takes longer to run ⏳
  • displaying the resulting layer with d.rast is also significantly slower 😭

Floyd-Steinberg dithering is optionally used with the -d flag. cute, optional, iconic ✨


🌸 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)

Latest change: Tuesday Jun 03 10:48:19 2025 in commit: 9e409925132a46abf5f445dc9b9cd9308cf215b1

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

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


and that's the whole page bestie 🫢 this lil manual came to you courtesy of GRASS 8.5.0, and yeah the footer said the same thing β€” GRASS 8.5.0, manual page for r.composite(1grass), periodt πŸ’…βœ¨

πŸ“¦ where this page comes from