0

I have 3 separate raster layers with binary values (1/0).

By assigning the 3 primary RGB colors to each of the layers, I would like to obtain a representation that expresses the overlap of the layers themselves with the derived colors, as in the diagram below.

I tried to reclassify the 3 layers by assigning the value 255 to the original 1 and the value 0 to the original 0, then I combined them into a single virtual layer by assigning a band to each of the 3 layers.

The result, however, is not what I expected, as shown in the first screenshot below.

Basically I get the white color where the 3 layers have overlap in the original value 1 (255) and the black where they have overlap in the original value 0 (0). However, I can't get the secondary colors cyan, magenta and yellow where only 2 layers overlap.

I can get the result I want by assigning one of the 3 RGB primary colors each to the 3 binary layers and using the "Addition" Blending mode in the Rendering Layer, as shown in the second screenshot. But in this way I'm forced to use a dark layer as background, to obtain pure secondary colors.

enter image description here

enter image description here

enter image description here

1
  • I already tried to do what you explained, but I kept having problems. However I realized that I had a problem with no data values on one of the 3 layers which was creating RGB rendering problems. Fixed the problem, everything was fine.
    – Peter J.
    Commented Feb 15 at 13:24

1 Answer 1

0

No need to reclassify the original rasters, binary works just fine. Build Virtual Raster and Merge both works here, what is important to check Place each input file into a separate band. This will allow you to use the Multiband color renderer to achieve the desired end result.

Once you created the merged/virtual raster, open the Layer Properties window.

  • Under Symbology, set the render type drop-down to Multiband color.
  • Select a different band (1;2;3) for each of the red, green, blue render bands.
  • Set the Min values to 0; and the Max values to 1 for each.
  • From the Contrast enhancement drop-down, select Stretch to MinMax.

Screenshot showing the described settings

And the result:

End result of color addition in QGIS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.