i.vi(1)
i.vi ๐
GRASS GIS User's Manual โ okay bestie, sit DOWN, because this one is a whole vibe. It's i.vi(1), and it's the imagery module that does vegetation indices. Yes, the whole alphabet soup of them. Grab a strawberry ๐ and let's go.
โจ NAME โจ
i.vi</purgle> โ Calculates different types of vegetation indices.
It mostly uses red and nir bands, and ngl some of these indices need extra bands too. Not all of them are low-maintenance, and that's fine ๐
๐ท๏ธ KEYWORDS ๐ท๏ธ
imagery, vegetation index, biophysical parameters, NDVI
๐ฆ SYNOPSIS ๐ฆ
i.vi
i.vi --help
i.vi output=name viname=type [red=name] [nir=name] [green=name]
[blue=name] [band5=name] [band7=name] [soil_line_slope=float]
[soil_line_intercept=float] [soil_noise_reduction=float]
[storage_bit=integer] [--overwrite] [--help] [--verbose] [--quiet]
[--ui]
๐ฉ Flags ๐ฉ
--overwriteโ lets your output files bulldoze anything already sitting there with the same name. Iconic, but be careful, she does not ask permission ๐ญ--helpโ prints the usage summary. Your little cheat sheet ๐ซถ--verboseโ verbose module output, aka she tells you EVERYTHING she's doing--quietโ quiet module output, aka she says nothing and just does the thing--uiโ forces the GUI dialog to launch. For when you want buttons instead of typing ๐ธ
๐ Parameters ๐
output=name[required] โ Name for output raster map. Yeah you gotta name your baby.viname=type[required] โ Type of vegetation index. The main character parameter fr fr.
Options: arvi, ci, dvi, evi, evi2, gvi, gari, gemi, ipvi, msavi, msavi2, ndvi, ndwi, pvi, savi, sr, vari, wdvi
Default: ndvi
Here's the full roster, bestie, every single one:
arvi: Atmospherically Resistant Vegetation Indexci: Crust Indexdvi: Difference Vegetation Indexevi: Enhanced Vegetation Indexevi2: Enhanced Vegetation Index 2gvi: Green Vegetation Indexgari: Green Atmospherically Resistant Vegetation Indexgemi: Global Environmental Monitoring Indexipvi: Infrared Percentage Vegetation Indexmsavi: Modified Soil Adjusted Vegetation Indexmsavi2: second Modified Soil Adjusted Vegetation Indexndvi: Normalized Difference Vegetation Indexndwi: Normalized Difference Water Indexpvi: Perpendicular Vegetation Indexsavi: Soil Adjusted Vegetation Indexsr: Simple Ratiovari: Visible Atmospherically Resistant Indexwdvi: Weighted Difference Vegetation Index
red=nameโ Name of input red channel surface reflectance map. Range:[0.0;1.0]nir=nameโ Name of input nir channel surface reflectance map. Range:[0.0;1.0]green=nameโ Name of input green channel surface reflectance map. Range:[0.0;1.0]blue=nameโ Name of input blue channel surface reflectance map. Range:[0.0;1.0]band5=nameโ Name of input 5th channel surface reflectance map. Range:[0.0;1.0]band7=nameโ Name of input 7th channel surface reflectance map. Range:[0.0;1.0]soil_line_slope=floatโ Value of the slope of the soil line (MSAVI and PVI only). Only those two, don't come for the others ๐soil_line_intercept=floatโ Value of the intercept of the soil line (MSAVI only)soil_noise_reduction=floatโ Value of the factor of reduction of soil noise (MSAVI only)storage_bit=integerโ Maximum bits for digital numbers.
If data is in Digital Numbers (i.e. integer type), give the max bits (i.e. 8 for Landsat -> [0-255])
Options: 7, 8, 10, 16
Default: 8
โจ DESCRIPTION โจ
i.vi crunches vegetation indices out of biophysical parameters. That's the whole vibe. You feed it bands, it hands you an index, bestie. ๐
Here's the full roster of indices it can serve you:
- ARVI โ Atmospherically Resistant Vegetation Index
- CI โ Crust Index
- DVI โ Difference Vegetation Index
- EVI โ Enhanced Vegetation Index
- EVI2 โ Enhanced Vegetation Index 2
- GARI โ Green atmospherically resistant vegetation index
- GEMI โ Global Environmental Monitoring Index
- GVI โ Green Vegetation Index
- IPVI โ Infrared Percentage Vegetation Index
- MSAVI2 โ second Modified Soil Adjusted Vegetation Index
- MSAVI โ Modified Soil Adjusted Vegetation Index
- NDVI โ Normalized Difference Vegetation Index
- NDWI โ Normalized Difference Water Index
- PVI โ Perpendicular Vegetation Index
- RVI โ ratio vegetation index
- SAVI โ Soil Adjusted Vegetation Index
- SR โ Simple Vegetation ratio
- WDVI โ Weighted Difference Vegetation Index
๐ Background for users new to remote sensing ๐
Okay so if you're brand new to this, listen up, because this part is literally the lore. Vegetation Indices are usually everyone's entry point into remote sensing for Earth land monitoring. And honestly? They're kind of suffering from their own success โ because so many people just grab satellite images off the internet and yeet them straight into this module without thinking twice. ๐ Not the move, bestie.
From Digital number to Radiance
Satellite imagery is usually stored as Digital Number (DN) just for storage reasons. Like, Landsat5 data is stored in 8-bit values (so, ranging from 0 to 255), and other satellites might be stored in 10 or 16 bits instead. Now here's the thing โ if your data is handed to you in DN, that means the imagery is "uncorrected". What that actually means is that the image is what the satellite sees from its own position and altitude up in space (stored in DN). It is not the signal at ground level yet. We call this data at-satellite or at-sensor. What's encoded in those 8 bits (or more) is the amount of energy the sensor inside the satellite platform sensed, and that energy is called radiance-at-sensor. Generally, satellite image providers encode the radiance-at-sensor into 8-bit (or more) through an affine transform equation (y=ax+b). If you're working with Landsat imagery, go look at i.landsat.toar โ it's the easy way to transform DN to radiance-at-sensor. And if you're using Aster data? Try the i.aster.toar module instead. ๐ฐ๏ธ
From Radiance to Reflectance
So finally, once you've got your radiance at sensor values... surprise, the atmosphere is still sitting there between the sensor and Earth's surface. ๐ญ And that fact needs correcting, to account for the atmospheric interaction with the sun's energy that the vegetation bounces back into space. For Landsat, you can do this in two ways. The simple way is through i.landsat.toar โ use e.g. the DOS correction. The more accurate way is by using i.atcorr (which, fun fact, works for many satellite sensors). Once the atmospheric correction has been applied to your satellite data, the data values are called surface reflectance. Surface reflectance ranges from 0.0 to 1.0 theoretically (and absolutely). And this level of data correction is the proper level of correction to use with i.vi. Periodt. ๐
๐ฟ Vegetation Indices ๐ฟ
Alright, formulas time. Buckle up, bestie, this is the good part. ๐
ARVI: Atmospheric Resistant Vegetation Index
ARVI is resistant to atmospheric effects (in comparison to the NDVI) and it gets there by a self-correcting process for the atmospheric effect in the red channel, using the difference in the radiance between the blue and the red channels (Kaufman and Tanre 1996).
arvi( redchan, nirchan, bluechan )
ARVI = (nirchan - (2.0*redchan - bluechan)) /
( nirchan + (2.0*redchan - bluechan))
CI: Crust Index
This one takes advantage of a unique spectral feature of soil biogenic crust containing cyanobacteria. It has been shown that the special phycobilin pigment in cyanobacteria contributes to producing a relatively higher reflectance in the blue spectral region than the same type of substrate without the biogenic crust. The spectral crust index (CI) is based on the normalized difference between the RED and the BLUE spectral values (Karnieli, 1997, DOI: 10.1080/014311697218368).
ci ( bluechan, redchan )
CI = 1 - (redchan - bluechan) /
(redchan + bluechan)
DVI: Difference Vegetation Index
dvi( redchan, nirchan )
DVI = ( nirchan - redchan )
EVI: Enhanced Vegetation Index
The enhanced vegetation index (EVI) is an optimized index designed to enhance the vegetation signal with improved sensitivity in high biomass regions, and improved vegetation monitoring through a de-coupling of the canopy background signal and a reduction in atmosphere influences (Huete A.R., Liu H.Q., Batchily K., van Leeuwen W. (1997). A comparison of vegetation indices global set of TM images for EOS-MODIS. Remote Sensing of Environment, 59:440-451).
evi( bluechan, redchan, nirchan )
EVI = 2.5 * ( nirchan - redchan ) /
( nirchan + 6.0 * redchan - 7.5 * bluechan + 1.0 )
EVI2: Enhanced Vegetation Index 2
This is a 2-band EVI (EVI2), no blue band needed, and it has the best similarity with the 3-band EVI โ particularly when atmospheric effects are insignificant and data quality is good (Zhangyan Jiang ; Alfredo R. Huete ; Youngwook Kim and Kamel Didan 2-band enhanced vegetation index without a blue band and its application to AVHRR data. Proc. SPIE 6679, Remote Sensing and Modeling of Ecosystems for Sustainability IV, 667905 (october 09, 2007) doi:10.1117/12.734933).
evi2( redchan, nirchan )
EVI2 = 2.5 * ( nirchan - redchan ) /
( nirchan + 2.4 * redchan + 1.0 )
GARI: green atmospherically resistant vegetation index
The formula was actually defined in: Gitelson, Anatoly A.; Kaufman, Yoram J.; Merzlyak, Mark N. (1996) Use of a green channel in remote sensing of global vegetation from EOS- MODIS, Remote Sensing of Environment 58 (3), 289-298. doi:10.1016/s0034-4257(96)00072-7
gari( redchan, nirchan, bluechan, greenchan )
GARI = ( nirchan - (greenchan - (bluechan - redchan))) /
( nirchan + (greenchan - (bluechan - redchan)))
GEMI: Global Environmental Monitoring Index
gemi( redchan, nirchan )
GEMI = (( (2*((nirchan * nirchan)-(redchan * redchan)) +
1.5*nirchan+0.5*redchan) / (nirchan + redchan + 0.5)) *
(1 - 0.25 * (2*((nirchan * nirchan)-(redchan * redchan)) +
1.5*nirchan+0.5*redchan) / (nirchan + redchan + 0.5))) -
( (redchan - 0.125) / (1 - redchan))
GVI: Green Vegetation Index
gvi( bluechan, greenchan, redchan, nirchan, chan5chan, chan7chan)
GVI = ( -0.2848 * bluechan - 0.2435 * greenchan -
0.5436 * redchan + 0.7243 * nirchan + 0.0840 * chan5chan-
0.1800 * chan7chan)
IPVI: Infrared Percentage Vegetation Index
ipvi( redchan, nirchan )
IPVI = nirchan/(nirchan+redchan)
MSAVI2: second Modified Soil Adjusted Vegetation Index
msavi2( redchan, nirchan )
MSAVI2 = (1/2)*(2*NIR+1-sqrt((2*NIR+1)^2-8*(NIR-red)))
MSAVI: Modified Soil Adjusted Vegetation Index
msavi( redchan, nirchan )
MSAVI = s(NIR-s*red-a) / (a*NIR+red-a*s+X*(1+s*s))
where a is the soil line intercept, s is the soil line slope, and X is an adjustment factor which is set to minimize soil noise (0.08 in original papers).
NDVI: Normalized Difference Vegetation Index
ndvi( redchan, nirchan )
Satellite specific band numbers ([NIR, Red]):
MSS Bands = [ 7, 5]
TM1-5,7 Bands = [ 4, 3]
TM8 Bands = [ 5, 4]
Sentinel-2 Bands = [ 8, 4]
AVHRR Bands = [ 2, 1]
SPOT XS Bands = [ 3, 2]
AVIRIS Bands = [51, 29]
NDVI = (NIR - Red) / (NIR + Red)
NDWI: Normalized Difference Water Index (after McFeeters, 1996)
This index is suitable for detecting water bodies. ๐ง
ndwi( greenchan, nirchan )
NDWI = (green - NIR) / (green + NIR)
The water content of leaves can be estimated with another NDWI (after Gao, 1996):
ndwi( greenchan, nirchan )
NDWI = (NIR - SWIR) / (NIR + SWIR)
This index is important for monitoring vegetation health โ and heads up, it is not implemented. ๐ญ
PVI: Perpendicular Vegetation Index
pvi( redchan, nirchan, soil_line_slope )
PVI = sin(a)NIR-cos(a)red
SAVI: Soil Adjusted Vegetation Index
savi( redchan, nirchan )
SAVI = ((1.0+0.5)*(nirchan - redchan)) / (nirchan + redchan +0.5)
SR: Simple Vegetation ratio
sr( redchan, nirchan )
SR = (nirchan/redchan)
VARI: Visible Atmospherically Resistant Index
VARI was designed to introduce an atmospheric self-correction (Gitelson A.A., Kaufman Y.J., Stark R., Rundquist D., 2002. Novel algorithms for estimation of vegetation fraction Remote Sensing of Environment (80), pp76-87.)
vari = ( bluechan, greenchan, redchan )
VARI = (green - red ) / (green + red - blue)
WDVI: Weighted Difference Vegetation Index
wdvi( redchan, nirchan, soil_line_weight )
WDVI = nirchan - a * redchan
if(soil_weight_line == None):
a = 1.0 #slope of soil line
โจ EXAMPLES โจ
okay bestie, real talk, this is the part where it all clicks. every example below takes reflectance values, feeds them to i.vi, and then peeks at the result with r.univar -e. the pattern is always the same, the index just changes. watch the shape of it and you can do literally any of them ๐
๐งฎ Calculation of DVI
the DVI glow-up from your reflectance values goes like this:
g.region raster=band.1 -p
i.vi blue=band.1 red=band.3 nir=band.4 viname=dvi output=dvi
r.univar -e dvi
๐ฟ Calculation of EVI
EVI from reflectance values? same energy, different index:
g.region raster=band.1 -p
i.vi blue=band.1 red=band.3 nir=band.4 viname=evi output=evi
r.univar -e evi
๐ฑ Calculation of EVI2
EVI2, and notice this one is chilling on band.3 for the region:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 viname=evi2 output=evi2
r.univar -e evi2
๐ Calculation of GARI
GARI time, and yes it needs green too:
g.region raster=band.1 -p
i.vi blue=band.1 green=band.2 red=band.3 nir=band.4 viname=gari output=gari
r.univar -e gari
โจ Calculation of GEMI
GEMI, no blue needed, we're being minimal:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 viname=gemi output=gemi
r.univar -e gemi
๐ Calculation of GVI
the calculation of GVI (Green Vegetation Index โ Tasseled Cap) from your reflectance values goes like this:
g.region raster=band.3 -p
# assuming Landsat-7
i.vi blue=band.1 green=band.2 red=band.3 nir=band.4 band5=band.5 band7=band.7 viname=gvi output=gvi
r.univar -e gvi
note the little# assuming Landsat-7comment, bestie. GVI is out here needingband5andband7too, so keep that in mind ๐
๐ฆ Calculation of IPVI
IPVI, quick and cute:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 viname=ipvi output=ipvi
r.univar -e ipvi
๐ธ Calculation of MSAVI
MSAVI, same recipe:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 viname=msavi output=msavi
r.univar -e msavi
๐ Calculation of NDVI
the icon itself, NDVI:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 viname=ndvi output=ndvi
r.univar -e ndvi
๐ง Calculation of NDWI
NDWI โ and look, this one gets an extra glow-up step with r.colors because water deserves a color ramp:
g.region raster=band.2 -p
i.vi green=band.2 nir=band.4 viname=ndwi output=ndwi
r.colors ndwi color=byg -n
r.univar -e ndwi
๐ Calculation of PVI
PVI, and here's where that soil_line_slope actually shows up in the wild:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 soil_line_slope=0.45 viname=pvi output=pvi
r.univar -e pvi
๐ Calculation of SAVI
SAVI, no cap:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 viname=savi output=savi
r.univar -e savi
โญ Calculation of SR
SR, simple ratio, simple life:
g.region raster=band.3 -p
i.vi red=band.3 nir=band.4 viname=sr output=sr
r.univar -e sr
๐ง Calculation of VARI
VARI, and heads up, this one's band assignments are a little quirky โ blue=band.2, green=band.3, red=band.4:
g.region raster=band.3 -p
i.vi blue=band.2 green=band.3 red=band.4 viname=vari output=vari
r.univar -e vari
๐ฐ๏ธ Landsat TM7 example
these next examples are all based on a LANDSAT TM7 scene that ships inside the North Carolina sample dataset. yes, the one everybody uses. iconic.
๐ง Preparation: DN to reflectance
first step, bestie, you literally cannot skip it: the original DN (digital number) pixel values have to be converted to reflectance using i.landsat.toar. to make that happen we make a copy of the channels (or rename them) so they match i.landsat.toar's input scheme:
g.copy raster=lsat7_2002_10,lsat7_2002.1
g.copy raster=lsat7_2002_20,lsat7_2002.2
g.copy raster=lsat7_2002_30,lsat7_2002.3
g.copy raster=lsat7_2002_40,lsat7_2002.4
g.copy raster=lsat7_2002_50,lsat7_2002.5
g.copy raster=lsat7_2002_61,lsat7_2002.61
g.copy raster=lsat7_2002_62,lsat7_2002.62
g.copy raster=lsat7_2002_70,lsat7_2002.7
g.copy raster=lsat7_2002_80,lsat7_2002.8
then you calculate the reflectance values from DN using DOS1 (the metadata came from p016r035_7x20020524.met.gz):
i.landsat.toar input=lsat7_2002. output=lsat7_2002_toar. sensor=tm7 \
method=dos1 date=2002-05-24 sun_elevation=64.7730999 \
product_date=2004-02-12 gain=HHHLHLHHL
and the resulting Landsat channels get named lsat7_2002_toar.1 .. lsat7_2002_toar.8. slay.
๐ฟ Calculation of NDVI
the calculation of NDVI from the reflectance values is done as follows:
g.region raster=lsat7_2002_toar.3 -p
i.vi red=lsat7_2002_toar.3 nir=lsat7_2002_toar.4 viname=ndvi \
output=lsat7_2002.ndvi
r.colors lsat7_2002.ndvi color=ndvi
d.mon wx0
d.rast.leg lsat7_2002.ndvi
North Carolina dataset: NDVI
๐ฆ Calculation of ARVI
the calculation of ARVI from the reflectance values is done as follows:
g.region raster=lsat7_2002_toar.3 -p
i.vi blue=lsat7_2002_toar.1 red=lsat7_2002_toar.3 nir=lsat7_2002_toar.4 \
viname=arvi output=lsat7_2002.arvi
d.mon wx0
d.rast.leg lsat7_2002.arvi
North Carolina dataset: ARVI
๐ Calculation of GARI
the calculation of GARI from the reflectance values is done as follows:
g.region raster=lsat7_2002_toar.3 -p
i.vi blue=lsat7_2002_toar.1 green=lsat7_2002_toar.2 red=lsat7_2002_toar.3 \
nir=lsat7_2002_toar.4 viname=gari output=lsat7_2002.gari
d.mon wx0
d.rast.leg lsat7_2002.gari
North Carolina dataset: GARI
๐ NOTES
this originally came from kepler.gps.caltech.edu (an FAQ):
A FAQ on Vegetation in Remote Sensing Written by Terrill W. Ray, Div. of Geological and Planetary Sciences, California Institute of Technology, email: terrill@mars1.gps.caltech.edu Snail Mail: Terrill Ray Division of Geological and Planetary Sciences Caltech, Mail Code 170-25 Pasadena, CA 91125
๐ REFERENCES
AVHRR, Landsat TM5:
- Bastiaanssen, W.G.M., 1995. Regionalization of surface flux densities and moisture indicators in composite terrain; a remote sensing approach under clear skies in mediterranean climates. PhD thesis, Wageningen Agricultural Univ., The Netherland, 271 pp. (PDF)
- Index DataBase: List of available Indices
๐ SEE ALSO
i.albedo, i.aster.toar, i.landsat.toar, i.atcorr, i.tasscap
๐ AUTHORS
- Baburao Kamble, Asian Institute of Technology, Thailand
- Yann Chemin, Asian Institute of Technology, Thailand
๐ซถ SOURCE CODE
Available at: i.vi source code (history)
Accessed: Saturday Jan 17 05:41:46 2026
Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index
ยฉ 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page, bestie ๐
this manual is for GRASS 8.4.2, and it's i.vi(1) โ go make some vegetation indices, you're gonna eat ๐โจ
๐ฆ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms