I'm using QGIS 3.4.1, and downloaded the SRTM TIFF data for the area of my interest, and added the TIFF format SRTM file to my project as a raster layer.
Here, I wish to make my own color gradient for SRTM raster layer using RGB values.
- Red and green will describe the color every 255m. Basic equation for R and G is height = R + (G*255). Here, if height is 500m, this will be 245 + (1*255), so RGB value will be (245, 1, 24). If height is 1000m, this will be 235 + (3*255), so RGB value will be (235, 3, 40). Value for blue is explained below.
- Blue will be used as some sort of "category" of height. B increase 8 for every 255m from -512m (it starts from -512m), up to B=255. For example, From -512m~-256m height, B=0. From -255m~0m height, B=8. From 1m~255m, B=16. From 256m~512m, B=24... Accordingly, above example of 500m should be (245, 1, 24), and 1000m should be (235, 3, 40)
This way, I wish to create my own color gradient scheme, to express height using specific RGB numbers. I'm trying raster calculator now, but as a beginner, making equation is not easy for me.
What should be the variable names for R, G, and B values?
I have one raster layer name "SRTM@1". I was thinking of equations like "SRTM@1" = "Red" + 255*"Green", but of course it is not working. I'm not sure if this is correct expression for RGB, and if my logic behind this equation is correct from raster calculator.