sRGB2LAB: Convert sRGB to LAB.

Description Usage Arguments Value Methods (by class) See Also Examples

Description

Wrapper function of sRGB and LAB that convert colors from sRGB to LAB.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sRGB2LAB(x, ...)

## S4 method for signature 'matrix'
sRGB2LAB(x)

## S4 method for signature 'numeric'
sRGB2LAB(x)

## S4 method for signature 'CanopyPhoto'
sRGB2LAB(x, ...)

Arguments

x

numeric, matrix or CanopyPhoto. Values must lying between 0 and 1.

...

Additional arguments as for writeRaster.

Value

Matrix, or CanopyPhoto.

Methods (by class)

See Also

normalize.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
sRGB2LAB(c(0.5,0.7,0.5))
x <- sRGB2LAB(matrix(c(normalize(1:90, 1, 90)), ncol = 3))
str(x)
head(x)

x <- loadPhoto()
x <- normalize(x, 0, 255)
x <- sRGB2LAB(x)
x
plot(x)

x <- system.file("external/Black_caiman_Macrofotografie_2.jpg", package="caiman")
x <- loadPhoto(x)
plotRGB(x)
x <- normalize(x, 0, 255)
x <- sRGB2LAB(x)
plot(x)

GastonMauroDiaz/caiman documentation built on Jan. 22, 2022, 4:43 a.m.