 Hello, this is Hans van der Krost, Senior Lecturer at IT Delft Institute for Water Education. In this video, you will learn more about styling rusters with the different renders that are available in QGIS. When you first load rusters into QGIS, they will get this default single-band grayscale legend. And they are most often not what you need. But what you need needs to be determined by you, because you know if a ruster is boolean, discreet or continuous and how you want to style it to convey the message to the people who are going to use the layers. Therefore, we need to use different renders for different data types. There's another video that explains more the different ruster data types. In this video, we'll look at the styling. Let's open the Layer Styling panel by clicking this button or pressing F7. And let's first have a look at this single-band gray renderer that is by default assigned to your ruster. Here we can choose the ruster and the renderer. We use single-band pseudo-color for continuous rusters, palleted unique values for boolean or discreet and multi-band color for multi-band remote sensing images, for example. Single-band means that there's only one band, so we can choose here only one band. We can choose if it's from black to white or white to black. We can change the minimum and maximum value. And we can change the settings of the minimum and maximum. And by default, these values are estimated, but if you want the actual values, you can change it and you get the real minimum and maximum value in the ruster layer. By default, it will stretch the minimum and maximum for the whole layer, but you can also change that to the current canvas or the updated canvas. With the updated canvas, it will update the stretching of the colors every time you move to a different extent. You can also use these other settings to have a cumulative count or mean plus or minus standard deviation. These settings depend on the contrast that you want to have in your image. You can also have some legend settings. You see that there in the layers panel, this will adjust according to what you choose here. And you can also change the minimum and maximum. If you keep it as default, it will use the minimum and maximum that's used for the styling. You can round the numbers. You can change things as the thousand separator, et cetera. And you can choose different number formats. Change the orientation. Now it's horizontal. You can also choose that the minimum is on top. These settings are for most ruster renders. And the font only applies to the print layout. These layer rendering settings are also common for all the renderers. We'll talk more about those. But here for the gray scale, you can also choose colorize and then instead of using a gray scale, it uses a scale on the color that you choose, in this case blue. And you can always reset. We'll talk more about those other settings later. If you have the live update checked on, you don't need to click apply. And you can always undo and redo your settings, which is a very useful functionality if you want to test some different settings of styling. This digital elevation model, however, is a continuous ruster and a better way to represent it is with single band pseudo color as a renderer. So first you need to choose a color ramp, otherwise it doesn't show anything. And you can choose one of these presets here. If you go to all color ramps, you see a few more. Let's choose red to blue. It's not very intuitive if you have the blue at the mountaintops, so you can also invert the color range. You can add here the label unit suffix to meters and then here in the label that will be printed. That's also taken over in the print layout. By default, it will use a linear interpolation. You can also go to discrete where the values are classified, and that's also what you see there in the layers panel. You can change those values, and it uses the less than or equal. And you see it also adjusts the label. You can change the mode from continuous to equal interval to adjust the amount of classes that you want to see. They will have an equal interval. You can also choose quantiles. There's also the option exact. With exact, it will use an equal sign for the values that you have in the value column. Let's switch back to linear and choose a more intuitive color ramp. You can create a new color ramp or edit the existing one. Here you can change the stops. You can add or remove stops, or you can change the color of the stops. Let's make it a bit purple, and we can remove that stop a little bit. The different ways to set the colors, and here we see the result applied immediately. It's much easier to use preset colors. So go back to create new color ramp. And there I choose CPT city, which is a catalog. This catalog has all kinds of thematic presets, such as bathymetry or different blue colors. Or for topography, we can choose different ones that are here. Simply select one, and then it will be applied. So for example, we can choose for topography the elevation one. You want to reuse it more easily. You can save it as a standard legend. Also here we can play with the contrast. So it updates the colors to the min and max in the view extent that we have here in the map canvas. You can also set as the value manually, then it will switch to user defined. Let's keep it at a minimum maximum of the full extent. Now there's also a hillshade renderer, and an easy way to apply that to the DEM is to make a duplicate of this layer. And to not get confused, we rename it to hillshade. Duplicate only affects the styling. It refers to the same data. We switch the layer to hillshade and the renderer to hillshade. You see that the layer name doesn't start with the capital and the renderer starts with the capital. And we can change here the resampling to bilinear to avoid these blocky artifacts. We can change the azimuth of the sun. And you see that when we don't have the sun in the northwest that we see the relief inverted. So normally we use their 350 degrees. You can also play with the altitude of the sun. And it lighter for 30 degrees or a bit darker at 60 degrees. I use the default here. And with the Z factor you can exaggerate the relief. And I've exaggerated it three times which gives a bit more dramatic effect. You can also use a multi-directional light source. Now a nice thing is to use blending with the DEM. So I switch back to the DEM and I go here under layer rendering to blending mode and I switch it to multiply. And now we see the colors of the DEM blended with our hillshade. And that gives a very nice result here where we can see all those river valleys and those mines very clearly. There are different blending modes that you can apply. Besides hillshade there's also a contour renderer which is very useful for elevation data. So I'm going to create another duplicate and rename it to contour. And this one needs to be on top because I want to see later the DEM in the background. Make sure that the contours layer is selected and use the contours renderer. And it uses some default values here that I'm going to play with. So the contour interval is the equidistance between the contour lines, so the elevation difference. Now it's set to 50. And an index contour is one that can have different stylings, for example, every 250 meter. We can use a thicker line or another color. So let's play a little bit with this. I put the contour interval on 10 and the index contour interval at 100. And because they now have the same style we don't see much difference. But I can click on the symbol and I can change the color or the opacity. I just play it now a little bit with the opacity. And here we see that the contours are now a bit lighter at the 10 meter interval. And the 100 meter interval is the thick line. And now it becomes more readable. And then if I also change here the stretching of the colors to the current canvas we can have this very nice elevation map. And here back under contours you can also change this input downscaling to more or less generalize the contour lines. Because they're derived from a roster and it can be quite blocky. So you can also play with that. And this is just for visualization. If you really want to have contour lines in vector format you go to the roster menu and then under extraction you can find contour. There's a very nice video from Klaus Carlsen on how to style vector contours using geometry generators. So far we have covered continuous rosters and rendered them in different ways. By single-band pseudo-color, by hillshade, or by contours. Let's now have a look at discrete rosters. There's this one with basins. And it is styled with the default single-band gray. If I query the data then I see that these pixels have integer numbers. And I can see they have sharp borders. So this is discrete rosters. So I use palleted unique values. You can choose here ramps, but because these numbers are not in a certain order I use here random colors. And this will assign to each value that it finds in the roster a unique color. You can not change each color manually or you can shuffle the random colors to get a different choice of colors assigned to the integer numbers of the pixels. Similar other features exist here as in the other renderers that were already explained. Boolean rosters with only true-falls, only zero and one are also styled with palleted unique values. But also strahler orders, which are in the ordinal format. Which means that the numbers are in a fixed order that cannot be changed. So there we need to use also the palleted unique values but we cannot use random colors. In this case we use a ramp. And we use here blues because the lower values are smaller rivers and the higher values are bigger rivers so we make them more blue if they are higher. And this shows us the nice pattern here of the drainage in this basin. We can also use blending mode here. But what you can also do is remove certain values that you don't want, then they become transparent. So here we only see value eight, nine, 10 of strahler and you can mix that with the other layers because the other values are transparent. You can add specific values that you want to make transparent. So if I want value eight to be transparent, I type eight there and then eight will not be visualized, they'll be transparent. And I can also change the global opacity there. But blending gives normally a nicer result. There's an option to calculate the raster histogram. So here you see that how the amount of strahler orders changes and there is the history. We can also change the labels. So in this case we would change it to one, two and three for the strahler orders because eight, nine and 10 doesn't make much sense. Here we have them all again and you see there in the colors that the strahler order eight is transparent because we said that eight needs to be transparent so we see the colors of the dem below. Now the different renderers that you use also affect the way the legends are generated in the print layout. Let's create a new print layout and add a legend to just see how that looks like. And here we see how the different renderers affect the legends that are created. So strahler is ordinal with a strange numbering because we changed it. The dem is continuous. We see the contours there and hillshade doesn't have a legend here and the basins are discrete colors. And then we can further adjust that there in the legend settings. So if you're more interested in the print layout check also the other videos on how to create beautiful maps in the print layout using QGIS.