Getting started
In this vignette, you will learn about the color space indexes provided by the package, with a focus on the RGB color space, the HSB color space, and the CIE-Lab color space.
Throughout the vignette, we will delve into the underlying formulas and methodologies used for converting colors between different color spaces, ensuring that you have a comprehensive understanding of how these transformations work.
RGB Color Space
The RGB (Red, Green, Blue) color space is a widely used color
representation in computer graphics and digital imaging. In the
pliman
package, we provide a range of indexes to analyze
and manipulate color data within the RGB color space:
Indexes in the RGB Color Space
Abbreviation | Name | Formula | Reference |
---|---|---|---|
B | Blue (445 nm) | B |
|
BCC | Blue Chromatic Coordinate Index | B/(R+G+B) |
De Swaef et al. (2021) |
BGI | Blue Green Pigment | B/G |
Zarco-Tejada et al. (2005) |
BI | Brightness Index | sqrt((R^2 + G^2 + B^2) / 3) |
A. J. Richardson and Wiegand (1977) |
BI2 | Brightness Index 2 | sqrt((R^2 + G^2 + B^2) / 3) |
|
BRVI | Blue Red Vegetation Index | (B-R)/(B+R) |
De Swaef et al. (2021) |
CI | Coloration Index | ((R - B) / R) |
|
CIVE | Color Index of Vegetation Extraction | (0.811*G)+(0.385*B)+18.78745) |
Kataoka et al. (2003) |
EGVI | Excess Green Index | 2 * G - R - B |
Woebbecke et al. (1995) |
ERVI | Excess Red Vegetation Index | ((1.4 * R) - G) |
Meyer and Neto (2008) |
GCC | Green Percentage Index | G/(R+G+B) |
A. D. Richardson et al. (2007) |
GD | Green Difference | Liang et al. (2017) | |
GLI | Green Leaf Index | ((G-R)+(G-B))/(G+R+G+B) |
Louhaichi, Borman, and Johnson (2001) |
GLAI | (25 * (G - R) / (G + R - B) + 1.25) |
||
GR | Green-Red Ratio | G / R |
|
GRAY | 0.299 * R + 0.587 * G + 0.114 * B |
||
GRAY2 | ((R^2.2 + (1.5 * G)^2.2 + (0.6 * B)^2.2) / (1 + 1.5^2.2 + 0.6^2.2))^(1/2.2) |
||
GRVI2 | Green Red Vegetation Index | (G-R)/(G+R) |
Motohka et al. (2010) |
G | Green (545 nm) | G |
|
GB | Green-Blue Ratio | G / B |
|
HI | Primary Colours Hue Index | (2*R-G-B)/(G-B) |
Escadafal, Belghit, and Ben-Moussa (1994) |
HUE | Overall Hue Index | atan(2*(B-G-R)/30.5*(G-R)) |
Escadafal, Belghit, and Ben-Moussa (1994) |
HUE2 | Overall Hue Index 2 | atan(2*(R-G-R)/30.5*(G-B)) |
Escadafal, Belghit, and Ben-Moussa (1994) |
I | Total intensity | R + G + B |
|
IPCA | Principal Component Analysis Index | 0.994*abs(R-B) + 0.961*abs(G-B) + 0.914*abs(G-R) |
Saberioon et al. (2014) |
L | Average Intensity | (R + G + B) / 3 |
|
MGVRI | Modified Green Red Vegetation Index | (G2 - R2) / (G2 + R2) |
Bendig et al. (2015) |
MVARI | Modified Visible Atmospherically Resistant Vegetation Index | (G - B)/(G + R - B) |
Z. Yang, Willis, and Mueller (2008) |
NB | Normalized Blue | B / (R + G + B) |
W. Yang et al. (2015) |
NDI | Normalized Difference Index | 128*((G - R)/(G + R) + 1) |
McNairn and Protz (1993) |
NG | Normalized Green | G / (R + G + B) |
W. Yang et al. (2015) |
NGBDI | Normalized Green-Blue Difference Index | (G-B)/(G+B) |
Bannari et al. (1995) |
NGRDI | Normalized Green-Red Difference Index | (G-R)/(G+R) |
Tucker (1979) |
NR | Normalized Red | R / (R + G + B) |
W. Yang et al. (2015) |
PRI | Photochemical Reflectance Index | R / G |
Gamon, Serrano, and Surfus (1997) |
R | Red (650 nm) | R |
|
RB | Red-Blue Ratio | R / B |
|
RCC | Red Chromatic Coordinate Index | R/(R + G + B) |
De Swaef et al. (2021) |
RGBVI | Red Green Blue Vegetation Index | (G2 - (B * R))/(G2 + (B * R)) |
Bendig et al. (2015) |
RI | Redness Index | (R^2 / (B * G^3)) |
|
SAT | Overall Saturation Index | ((max(R, G, B) - min(R, G, B)) / max(R, G, B)) |
|
SAVI | Soil Adjusted Vegetation Index | (1 + 0.5)*(G-R)/(G+R+0.5) |
Li et al. (2010) |
SCI | Soil Colour Index | (R - G) / (R + G) |
Mathieu et al. (1998) |
SHP | Shape Index | (2 * (R - G - B) / (G - B)) |
|
SI | Normalized Red-Blue Difference Index | (R-B)/(R+B) |
Escadafal, Belghit, and Ben-Moussa (1994) |
S | Saturation | ((R + G + B) - 3 * B) / (R + G + B) |
|
TGI | Triangular Greenness Index | G - 0.39*R - 0.61*B |
Hunt et al. (2013) |
VARI | Visible Atmospherically Resistant Index | (G-R)/(G+R-B) |
Anatoly A. Gitelson et al. (2002a) |
VEG | Vegetative Index | G/(R^0.667 * B^0.334) |
Hague, Tillett, and Wheeler (2006) |
vNDVI | Visible NDVI | 0.5268 * (R - 0.1294*G**0.3389 * B - 0.3118) |
Costa, Nunes, and Ampatzidis (2020) |
WI | Woebbecke Index | G - B)/(R - G) |
Woebbecke et al. (1995) |
Multispectral indexes
{pliman} provides tools to analyze up to 5 bands , which are generally B, G, R, RE (red-edge) and NIR (near-infrared). The following build-in indexes are available.
Abbreviation | Name | Formula | Reference |
---|---|---|---|
ARI | Anthocyanin Reflectance Index | (1 / G) - (1 / RE) |
A. A. Gitelson, Merzlyak, and Chivkunova (2001) |
ARVI | Atmospherically Resistant Vegetation Index | (NIR - (R - 0.1*(R-B))) / (NIR + (R - 0.1*(R-B))) |
Kaufman and Tanre (1992) |
BAI | Burn Area Index | 1/((0.1 - R)^2 + (0.06 - NIR)^2) |
Chuvieco, Martín, and Palacios (2002) |
BWDRVI | Blue-Wide Dynamic Range Vegetation Index | (0.1*NIR-B)/(0.1*NIR+B) |
Anatoly A. Gitelson (2004) |
CCCI | Canopy Chlorophyll Content Index | ((NIR-R)/(NIR+R))/((NIR-R)/(NIR+R)) |
Index DataBase (2023) |
CIG | Chlorophyll Index Green | (NIR/G)-1 |
Anatoly A. Gitelson, Gritz †, and Merzlyak (2003) |
CIRE | Chlorophyll Index - Red-Edge | (NIR/RE)-1 |
Anatoly A. Gitelson, Gritz †, and Merzlyak (2003) |
CVI | Chlorophyll Vegetation Index | NIR * (R/(G*G)) |
Index DataBase (2023) |
CVI | Chlorophyll Vegetation Index | NIR*(R/G^2) |
Vincini, Frazzi, and D’Alessio (2008) |
EVI | Enhanced Vegetation Index | 2.5*(NIR-R)/(NIR+6*R-7.5*B+1) |
A. Huete et al. (2002) |
GARI | Green Atmospherically Resistant Index | (NIR - (1.7 * (B-R))) / (NIR + (1.7 * (B-R))) |
Anatoly A. Gitelson, Kaufman, and Merzlyak (1996) |
GEMI | Global Environmental Monitoring Index | (2*(NIR*NIR-R*R)+1.5*NIR+0.5*R)/(NIR+R+0.5)*(1-0.25*(2*(NIR*NIR-R*R)+1.5*NIR+0.5*R)/(NIR+R+0.5))-((R-0.125)/(1-R)) |
Pinty and Verstraete (1992) |
GDVI | Green Difference Vegetation Index | NIR-G |
Index DataBase (2023) |
GNDVI | Normalized Difference NIR/G | (NIR - G) / (NIR + G) |
Anatoly A. Gitelson and Merzlyak (1996) |
GOSAVI | Green Optimized Soil Adjusted Vegetation Index | (NIR-G)/(NIR+G+0.16) |
Index DataBase (2023) |
GRVI | Green Ratio Vegetation Index | NIR / G |
Sripada et al. (2006) |
GSAVI | Green Soil Adjusted Vegetation Index | ((NIR-G)/(NIR+G+0.5))*(1+0.5) |
Index DataBase (2023) |
IPVI | Infrared Percentage Vegetation Index | NIR / (NIR + R) |
Crippen (1990) |
LAI | Leaf Area Index | 3.368 * (2.5*(NIR-R)/(NIR+6*R-7.5*B+1)) - 0.118 |
Boegh et al. (2002) |
MCARI1 | Modified Chlorophyll Absorption in Reflectance Index 1 | 1.2*((2.5*(NIR-R))-(1.3*(NIR-G))) |
Haboudane et al. (2004) |
MCARI2 | Modified Chlorophyll Absorption in Reflectance Index 2 | ((1.2*(2.5*(NIR-R)-1.3*(NIR-G))/sqrt((2*NIR+1)^2-(6*NIR-5*sqrt(R))-0.5))) |
Haboudane et al. (2004) |
MSAVI | Modified Soil Adjusted Vegetation Index | (1/2)*(2*(NIR+1)-sqrt((2*NIR+1)*2-8*(NIR-R))) |
Qi et al. (1994) |
MSAVI2 | Modified Soil Adjusted Vegetation Index 2 | (2 * NIR + 1 - sqrt((2 * NIR + 1)^2 - 8 * (NIR - R))) / 2 |
Qi et al. (1994) |
MSR | Modified Simple Ratio | (NIR / R - 1) / (sqrt(NIR / R) + 1) |
Chen (1996) |
NDRE | Normalized Difference NIR/Rededge | (NIR-RE)/(NIR+RE) |
A. Gitelson and Merzlyak (1994) |
NDI | Non-Linear Index | (NIR ^2 - R) / (NIR ^2 + R) |
Goel and Qin (1994) |
NDVI | Normalized Difference Vegetation Index | (NIR - R) / (NIR + R) |
Kriegler (1969) |
NDWI | Normalized Difference Water Index | (G-NIR)/(G+NIR) |
McFEETERS (1996) |
OSAVI | Optimized Soil Adjusted Vegetation Index | (NIR-R)/(NIR+R+0.16) |
Rondeaux, Steven, and Baret (1996) |
PNDVI | Pan NDVI | ((NIR-(G+R+B))/(NIR+(G+R+B))) |
Index DataBase (2023) |
PSRI | Plant Senescence Reflectance Index | (R-G)/RE |
Merzlyak et al. (1999) |
RDVI | Renormalized Difference Vegetation Index | (NIR - R) / (sqrt(NIR + R)) |
Roujean and Breon (1995) |
RESR | Red-Edge Simple Ratio | NIR/RE |
Anatoly A. Gitelson et al. (2002b) |
RVI | Ratio Vegetation Index | R/NIR |
Pearson and Miller (1972) |
SAVI | Soil Adjusted Vegetation Index | ((NIR-R) / (NIR + R + 0.5) * 1 + 0.5) |
A. R. Huete (1988) |
TCARI | Transformed Chlorophyll Absorption in Reflectance Index | 3 * ((RE - R) - 0.2 * (RE - G) * (RE/R)) |
Haboudane et al. (2002) |
TDVI | Transformed Difference Vegetation Index | 1.5 * ((NIR - R) / (sqrt(NIR ^2 + R + 0.5))) |
Bannari, Asalhi, and Teillet (2002) |
TSAVI | Transformed Soil Adjusted Vegetation Index | (2*((NIR-2)*(R-1)))/(R+2*(NIR-1)+0.5*(1+2*2)) |
Baret, Guyot, and Major (1989) |
TVI | Transformed Vegetation Index | sqrt((NIR - R) / (NIR + R) + 0.5) |
Broge and Leblanc (2001) |
VARIRE | Visible Atmospherically Resistant Index (red-edge) | (RE - 1.7 * R + 0.7 * B) / (RE + 2.3 * R - 1.3 * B) |
Anatoly A. Gitelson et al. (2002c) |
VIG | Vegetation Index (green) | (G-R)/(G+R) |
Anatoly A. Gitelson et al. (2002c) |
VIN | Vegetation Index Number | NIR/R |
Pearson and Miller (1972) |
VIRE | Vegetation Index (red-edge) | (RE-R)/(RE+R) |
Anatoly A. Gitelson et al. (2002c) |
WDRVI | Wide Dynamic Range Vegetation Index | (0.2 * NIR - R) / (0.2 * NIR + R) |
Anatoly A. Gitelson (2004) |
Usefull references
HSB Color Space
The HSB (Hue, Saturation, Brightness) color space is an alternative color representation that emphasizes the perceptual aspects of color.
Conversion to CIE-Lab
The rgb_to_hsb()
function can be used to convert RGB to
HSB color space. The conversion is performed according to described by
Karcher and Richardson (2003).
-
Hue (H):
- If max (R,G,B) = R,
H = 60 * (G - B) / (max(R,G,B) - min(R,G,B))
- If max (R,G,B) = G,
H = 60 * (2 + (B - R) / (max(R,G,B) - min(R,G,B))
- If max (R,G,B) = B,
H = 60 * (4 + (R - G) / (max(R,G,B) - min(R,G,B))
- If max (R,G,B) = R,
-
Saturation (S):
S = (max(R,G,B) - min(R,G,B)) / max(R,G,B)
-
Brightness (B):
B = max(R,G,B)
CIE-Lab Color Space
The CIE-Lab (CIELAB) color space is a color model that approximates
human vision and is often used for color difference analysis and color
correction. In the pliman
package, we support the
conversion from RGB to Lab color space.
Conversion to CIE-Lab
The conversion from RGB to Lab is performed by the
rgb_to_lab()
function in the pliman
package.
This involves several steps, including the transformation from RGB to
sRGB, sRGB to XYZ, and then from XYZ to Lab.
To understand the specific formulas and steps involved in this conversion, please refer to the detailed formulas.