tricolore
tricolore copied to clipboard
Can this tricolore be used in spatial raster with 3 bands?
Hello! Can this tricolore be used in spatial raster with 3 bands, i.e., RGB color maps?
I believe it cant used in spatial raster. But some extra processes can be used to achieve this goal. Firstly, convert the raster into box polygon shapefile, the 3-dimension field is attached. Then, use tricolore package to achieve this goal.
It appears not to be applicable to RGB composition, but it can be used for spatial rasters with three layers. As long as you convert the raster to a data.frame, you can use the function Tricolore() to calculate the color composition code obtained from three variables. For plotting, functions such as geom_raster() need to be employed.
Tricolore can only meaningfully be used to map ternary compositional data, i.e. data where the sum of the three components is 1 (or some other constant). An example would be a map of soil composition (% sand, % clay, % silt).
However, RGB composite images are not compositional because the sum of the three components can be anything from 0 to 3*255 if you map three 8-bit channels to their respective RGB mixture. So if your goal is to, say, map three bands of some satellite image to three colors, then you should not use tricolore because you will lose any magnitude information in the color coding, e.g. (10, 10, 10) and (100, 100, 100) would be mapped to the same color. Misleadingly, such RGB composite images are sometimes shown with a ternary legend, but the legend should actually be the RGB color cube.