[Qgis-user] Raster layer opacity expression - how does it work?

Jonathan Schultz jonathan at schultz.la
Mon Dec 6 04:25:00 PST 2021


Thanks for the quick response.

I tried following your suggestion but it doesn't seem to be quite what I 
want. If I understand correctly, what it does is overlay solid grey at 
50% opacity over the layer that I want to highlight. Any layers under 
that layer therefore also get the 50% grey overlaid on them, which I 
don't want.

I'd still really like to know what can be done using an expression for 
the Global Opacity of a raster layer.

Cheers,
Jonathan

On 6/12/21 00:07, Ujaval Gandhi wrote:
> I assume you are trying to set the opacity to 50% outside of a polygon 
> layer. This can be done using the 'Inverted Polygon' renderer. See this 
> screenshot https://ibb.co/Sf5HySf <https://ibb.co/Sf5HySf>
> 
> Logo <https://spatialthoughts.com/>	
> Ujaval Gandhi
> Spatial Thoughts
> mobile: +91-8095684687
> email: ujaval at spatialthoughts.com <mailto:ujaval at spatialthoughts.com>
> LinkedIn icon <https://www.linkedin.com/in/spatialthoughts/> Twitter 
> icon <https://twitter.com/spatialthoughts>
> 
> 
> 
> 
> On Sun, Dec 5, 2021 at 5:12 PM Jonathan Schultz <jonathan at schultz.la 
> <mailto:jonathan at schultz.la>> wrote:
> 
>     Hello,
> 
>     I'm trying to use opacity on a raster layer to highlight an area of
>     interest. So, for example, I would use opacity 100 for an area (defined
>     in another layer), and 50 for anywhere outside that area. But I can't
>     seem to even find basic documentation on how the Renderer opacity
>     values
>     work. If I enable the Assistant I get a bunch of fields: Source (an
>     expression), Values from and to, plus a checkbox "Apply transform
>     curve"
>     with its own set of fields.
> 
>     When I google words like "Renderer opacity" all I get are references to
>     the source code but no documentation or examples.
> 
>     This is QGIS version 3.22.0-Białowieża running on Linux/Debian.
> 
>     Does anyone know how this stuff works, or how I could find out?
> 
>     Thanks!
>     _______________________________________________
>     Qgis-user mailing list
>     Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
>     List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>     Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
> 


More information about the Qgis-user mailing list