I’ve just pushed my first major contribution to QGIS — the ability to set the compositing mode for a layer. Compositing is a technique widely used by cartographers and graphic artists to fine tune how layers are blended together, and it allows for some spectacular results! Until now, the only way to get these effects would be to export a map to a separate editor like Photoshop or GIMP and playing with the layer modes there. But with QGIS 2.0, blending can be controlled via a simple drop down menu for both raster and vector layers:
So what makes this so great? Well, in previous versions the only option for compositing layers in QGIS was by setting a layer’s opacity. This approach has some limitations. Let’s say you want to overlay two raster layers – a basemap layer and a heatmap. You could place the heatmap layer over the basemap and set its transparency at 50% so that the basemap shows through, but then both the basemap and heatmap layers will be partially faded out:
With QGIS 2.0, you’ll be able to use the “multiply” blend mode to overlay these layers. This means both the heatmap and underlying basemap will be shown with full intensity:
Ok… perhaps that’s not the prettiest example, but it is something I have to do a lot in my job. Until now it’s only been possible by exporting the map to GIMP or Photoshop/Illustrator and setting the blend modes there. That’s always fiddly, time consuming and generally frustrating all round. Much easier to just change it with a dropdown within QGIS itself.
Let’s move on to some more impressive example. First, here’s a terrain map using a combination of a landcover thematic with ‘overlay’ blending and a hillshade set to ‘multiply‘ blending. The graticule lines are also set to overlay – note how they aren’t visible over the lighter water areas and brighter hillshade regions.
Ok, that’s nice, but let’s try something a little different. Using a combination of darken, screen, hard light and overlay:
These a just some rough examples — I’m keen to see what results others get using this feature (feel free to post links to your work in the comments).
One final note: I’m really appreciative of the efforts of the QGIS dev team, who’ve been really supportive and helpful while I find my way around the QGIS codebase. A big thank you has to go to Nathan Woodrow for taking the time to review this commit and answering all the questions I’ve had!
I think this is a great feature to add to QGIS. As you said, the opacity settings when overlaying images don’t get the best results.
I did similar things a couple times (DEM + hillshade + slope) using GDAL and Mapnik, but didn’t get the results I was looking for. Didn’t go a lot further thought, I was just playing around.
This will be only a visualization tool or it will also allow to export the output as a georeferenced raster ?
In any case, cheers to everybody working in improving QGIS and OSGEO. I’m trying to work my way there, but I’m still on the basics.
Well, it currently works with maps exported directly as images (these are georeferenced, but not necessarily the full resolution of the input layers) and in exported composer views. While QGIS 2.0 does allow you to save raster layers with symbology at their original resolution I’m pretty sure this only applies to single layers, not compositions of multiple layers. It’s not a bad idea though!
You are very welcome. Thanks for your contribution to the project.
Great Job! I have been dreaming for this feature for a long time in GIS software. I’m glad that it came up in QGIS. Thank you for your hardwork!
Lovely stuff man!
Great job. Can’t wait to use it! Thanks!
This will take QGIS 2.0 to next level and I dont see this feature even in commercial products. Hats off ..
Cool stuff. Really awesome carto tool. Thank you.
I am big fan of Q-GIS . Your team is doing really great work !!! In India in my school (@Pune) QGIS is using for practical session for viewing map and applying colors to map : )
I am happy with qgis : )
[…] nyalldawson.net you can read more about the upcoming ‘blend modes for layers‘. These effects, previously only found in photo/image editors like GIMP or photoshop, will […]
[…] Grafikprogrammen wie GIMP oder Photoshop kennt, in QGIS zu nutzen. Das unglaubliche Feature bringt Ebeneneffekte wie Multiplizieren, Abdunkeln oder Aufhellen. Das interessante Feature ermöglicht es bei […]
I really get stuck on those nice basemaps in the heatmapimages. You have a stylesheet for those? 🙂
Actually, I can’t take credit for those (although I’d love to)! They’re just a digital copy of the local street directory which has been converted to grayscale. Sorry!
Absolutely loving this feature– now using it in every map that comes out of Quantum.
It’s absolute a great enhancement !
I’v played with and I’m looking forward to using version 2 of QGIS 😉
I also ask for 2 enhancements to your system.
A mask/cut mode : http://hub.qgis.org/issues/7813
and a desaturate (in and out) mode : http://hub.qgis.org/issues/7812
[…] http://nyalldawson.net/2013/03/coming-soon-in-qgis-2-0-blend-modes-for-layers/ […]
[…] fantastic cartographic capabilities including some that are not available in any other GIS package: Blending Modes and Live Layer […]
[…] improve this is to take advantage of blending (or “composition”) modes (which QGIS has native support for). The white labels will be most readable when there’s a good contrast with the background […]
[…] de superposer des couches de façon très sophistiquée grâce à différents modes de fusion (dont devrait se doter à l’avenir QGIS 2.0, […]