I have a 4-band raster image (RGB), downloaded from a WMS, representing clay content of topsoil ranging from brown (high clay content) to yellow (low clay content). The 4th band is alpha-band, with constant 255 values.
Instead of the red, green, blue values (all of them ranging from 0 to 255) the concentration is needed (ranging from 0 to 100). As a help, at certain points, I have the corresponding percentage (see the image above). That means, I have a lookup table like this:
R, G, B , percentage
244, 229, 115, 9
242, 187, 62, 26
220, 148, 37, 33
183, 97, 6, 41
177, 87, 1, 43
The question is, how can I get the value of clay content in percentage for every raster pixel.
For me this looks much like an interpolation task; however, resample, interp, approx work only in fewer dimensions.
Here is a similar problem however with a different color ramp.