tricolore icon indicating copy to clipboard operation
tricolore copied to clipboard

Can this tricolore be used in spatial raster with 3 bands?

Open Yelong-Z opened this issue 2 years ago • 2 comments

Hello! Can this tricolore be used in spatial raster with 3 bands, i.e., RGB color maps?

Yelong-Z avatar Mar 02 '23 06:03 Yelong-Z

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.

GISWLH avatar May 18 '23 08:05 GISWLH

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.

Rimagination avatar Feb 17 '24 04:02 Rimagination

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.

jschoeley avatar May 16 '24 07:05 jschoeley