[Qgis-user] can't apply mask on labels
Andreas Neumann
andreas at qgis.org
Thu Mar 7 00:36:09 PST 2024
Hi all,
The mask is more flexible and cartographically more pleasing if you don't
have a white background on your map. Also, if your background varies
(multiple colors (e.g. lake, forest, agriculture), the mask is the only way
to get rid of darker colors while keeping light background colors.
See f.e. this example here:
https://s.geo.admin.ch/bb5itd6k85y7
Have a look at the large labels "Pfaffhausen", "Benglen", "Schwerzenbach"
and "Fällanden". Darker colors from roads (black) and rivers (blue) are
masked, but lighter colors from forests, lakes and hillshading are
preserved. The mask is the only way to achieve this "selective" effect of
masking.
All other options like background rectangles or buffers have a fixed color
and only work on a homogeneous background. They wouldn't be able to achieve
the effect of the example above.
I hope this clarifies the difference in the approaches?
The only major problems with the masks are the following limitations
(hopefully they can be removed in the future):
- they cannot be used within the same layer (you need to duplicate layers
if you want to mask features with labels from the same layer)
- they don't yet work on vector tiles, because vector tiles aren't real
QGIS vector layers with all the symbology options. They only have a limited
set of symbology so far
Greetings,
Andreas
On Thu, 7 Mar 2024 at 09:19, Huesmann, Michaela via QGIS-User <
qgis-user at lists.osgeo.org> wrote:
> Hello all,
>
>
>
> I always use the funktion „Tampon“ (German „Puffer“) instead of „Masque“
> (German „Maske“) because I still do not understand how to configurate a
> mask.
>
> Also I wonder what the difference in symbology and use is. Maybe someon
> can explain that to me and the group?
>
>
>
> With the Tampon/Buffer/Puffer I do not need to duplicate the Layer.
>
>
>
> Puffer
>
>
>
>
>
>
>
> Maske
>
>
>
> Duplication of the layer and mask for the duplicate with label does not
> work in my test. I tried different choices in the options.
>
>
>
>
>
>
>
>
>
>
>
>
> [image: Kreisstadt Steinfurt] <http://www.steinfurt.de>
>
> - 48565 Steinfurt
> www.steinfurt.de
>
> Mit freundlichen Grüßen
> im Auftrag
> Michaela Huesmann
> Geodaten
> Fachdienst Tiefbau
>
> Tel.: +49 2552 925 219
> Fax:
> E-Mail: michaela.huesmann at Stadt-Steinfurt.de
> Bitte denken Sie an die Umwelt, bevor Sie diese E-Mail ausdrucken.
>
> *Von:* QGIS-User <qgis-user-bounces at lists.osgeo.org> * Im Auftrag von *Andreas
> Neumann via QGIS-User
> *Gesendet:* Mittwoch, 6. März 2024 21:29
> *An:* Émilie Berthiaume <eberthiaume at csfoy.ca>
> *Cc:* qgis-user at lists.osgeo.org
> *Betreff:* Re: [Qgis-user] can't apply mask on labels
>
>
>
> Hi Emilie,
>
>
>
> I believe that currently a limitation that a layer cannot mask itself.
>
>
>
> For this to work, you'd have to duplicate the layer - once for the lines
> and once for the labels - then the mask should work. On the label layer you
> can disable the drawing of the lines and of course on the line layer you
> only apply the mask from the other layer, but don't enable any labels.
>
>
>
> Not sure if - or how soon this limitation can be fixed.
>
>
>
> Hope this helps,
>
> Andreas
>
>
>
> On Wed, 6 Mar 2024 at 21:00, Émilie Berthiaume via QGIS-User <
> qgis-user at lists.osgeo.org> wrote:
>
> Hi,
>
>
>
> I’m trying to apply a mask on the labels of my contour lines layer in a
> topographic map project. I have activated the mask in the labels tab :
>
>
>
>
>
> And then I activated the symbol I wanted to hide in the mask tab :
>
>
>
>
>
>
>
> But it doesn’t seem to work. There is still a line underneath my labels :
>
>
>
>
>
> Can anyone tell me what I am doing wrong? Thank you,
>
>
>
> *Émilie Berthiaume*
>
> Enseignante
>
> Département de biologie et Techniques de bioécologie
>
>
>
> *Ce message est confidentiel et est à l'usage exclusif du destinataire
> nommé ci-dessus. Si vous recevez ce message par erreur, sachez qu'il est
> interdit de le diffuser, de le distribuer, d'en dévoiler le contenu ou de
> le reproduire. Veuillez informer immédiatement l'expéditeur par courrier
> électronique et détruire l'original de ce message ainsi que toute copie. *
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> --
>
>
> --
> Andreas Neumann
>
> QGIS.ORG board member (treasurer)
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
--
--
Andreas Neumann
QGIS.ORG board member (treasurer)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 14168 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image015.jpg
Type: image/jpeg
Size: 2643 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0007.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 39419 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0008.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 36007 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0009.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 25153 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0010.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image016.jpg
Type: image/jpeg
Size: 24388 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0011.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image017.jpg
Type: image/jpeg
Size: 19030 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0012.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image018.jpg
Type: image/jpeg
Size: 1994 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0013.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imageb68d91.JPG
Type: image/jpeg
Size: 10418 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240307/0d49745d/attachment-0001.jpe>
More information about the QGIS-User
mailing list