Coming soon in QGIS 2.0 – blend modes for layers

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:

Blending modes for a raster layer

Woohoo… blending modes in QGIS!

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:

Overlaying layers with transparency

Overlaying layers by altering transparency – see how both the heatmap and basemap are partially faded

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:

Overlaying rasters with multiply

Overlaying rasters with “multiply” blend mode – both layers are shown in their 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.

Hill shading with advanced compositing

Hill shading with advanced compositing… Hal Shelton would be proud!

Ok, that’s nice, but let’s try something a little different. Using a combination of darkenscreenhard light and overlay:

Stamen-style watercolors directly within QGIS!

Live Stamen-style watercolors within QGIS – sweet!

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!

Tagged , , , , ,

20 thoughts on “Coming soon in QGIS 2.0 – blend modes for layers

  1. Stephane Goldstein says:

    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.

    • Nyall says:

      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!

  2. You are very welcome. Thanks for your contribution to the project.

  3. Alexandre Neto says:

    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!

  4. Tim Sutton says:

    Lovely stuff man!

  5. R.Nanclares says:

    Great job. Can’t wait to use it! Thanks!

  6. Ganesh says:

    Great 🙂

    This will take QGIS 2.0 to next level and I dont see this feature even in commercial products. Hats off ..

  7. Arunmozhi says:

    Cool stuff. Really awesome carto tool. Thank you.

  8. Sunil Palkar says:

    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 : )

  9. […] 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 […]

  10. […] 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 […]

  11. Henrik says:

    I really get stuck on those nice basemaps in the heatmapimages. You have a stylesheet for those? 🙂

    • Nyall says:

      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!

  12. Absolutely loving this feature– now using it in every map that comes out of Quantum.

  13. Kagou says:

    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 :
    and a desaturate (in and out) mode :


  14. […] fantastic cartographic capabilities including some that are not available in any other GIS package: Blending Modes and Live Layer […]

  15. […] 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 […]

  16. […] 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, […]

Leave a Reply

Your email address will not be published. Required fields are marked *