i.hyper.composite creates RGB, CIR, SWIR and custom false-color composites from a hyperspectral 3D raster map (raster_3d).
The module reads per-band wavelength metadata from the 3D raster (as written by i.hyper.import / i.hyper.preproc), selects the nearest available bands to requested wavelengths, enhances contrast, and composes a 2D color raster.
Internally, the cube is temporarily exploded into 2D rasters (one per band) using r3.to.rast. For each composite, the nearest bands to target wavelengths are chosen, optional color enhancement is applied with i.colors.enhance, and the final composite is produced with r.composite. Temporary rasters and the temporary region are automatically cleaned up.
Predefined composites are provided for common use-cases; custom triplets (R,G,B in nm) are supported for sensor-agnostic workflows.
Built-in composites (target wavelengths in nm):
Custom composite: specify composites_custom=R,G,B (wavelengths in nm), e.g. 2200,848,572 or 560,860,1640. The module selects the nearest available band to each requested wavelength; it does not resample spectrally.
r3.info (e.g., lines like Band 17: 848 nm); otherwise the module aborts with a clear error.i.colors.enhance is run with the provided strength (0–100). For the rgb composite, the -p flag is used to preserve natural RGB balance; other composites run without -p.map — input hyperspectral 3D raster map (required).output — output name prefix for generated composites (required).composites=rgb,cir,swir_agriculture,swir_geology — list of presets to create (optional, multiple allowed).composites_custom=R,G,B — custom wavelengths in nm, e.g. 2200,848,572 (optional).strength — enhancement strength for i.colors.enhance (0–100, default: 96).
# Set the region
g.region raster_3d=prisma
# Example 1: True color (RGB) and CIR from PRISMA
i.hyper.composite map=prisma output=prisma \
composites=rgb,cir
# Console output:
Generated composite raster: prisma_rgb
Generated composite raster: prisma_cir
# Example 2: SWIR geology composite from EnMAP
# Set the region
g.region raster_3d=enmap
i.hyper.composite map=enmap output=enmap \
composites=swir_geology strength=90
# Console output:
Generated composite raster: enmap_swir_geology
# Example 3: Custom Snow/Ice composite (Green–NIR–SWIR)
# Set the region
g.region raster_3d=tanager
# Uses nearest bands to 560, 860, and 1640 nm
i.hyper.composite map=tanager output=snowice \
composites_custom=560,860,1640 strength=92
# Console output:
Generated composite raster: snowice_custom
Available at: i.hyper.composite source code (history)
Latest change: Monday Nov 17 15:45:17 2025 in commit: 615887d217deac99a8f08bcf940384863fd47f2b
Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2dev Reference Manual