I have again a series of cities names on a map. I have a solution to fill a background rectangle that can be semi transparent to make the text always visible, great.

What I want to do now is attributing a variable fore color to the text generating the maximum contrast, like the text in the bottom in this image:

enter image description here

What could be the way to automate this process in Inkscape?

1 Answer 1


You can get something kind of similar, by using a modified Blend filter.

  1. Type some white text, and make sure the text object is selected
  2. Click Filters > Fill and Transparency > Blend
  3. Set the source to Background
  4. Open the Filter Editor
  5. Change the Mode to Exclusion

enter image description here

Note: the contrast is not as strong/vivid as your example because effect is dependent on the colour of the background image. Also if the text is set to white, the effect won't work over areas of white. If you move the text over coloured areas of the background for example, it will change reds to blue and modify other colours to their opposites.

  • The solutions seems so great! but I can't reproduce it in Inkscape 0.92.3. Select text, Click filters -> Fill, edit filter, mode exclusion. I see exactly what you have proposed and yet nothing happens. The background is a PNG image in a different layer. Feb 12, 2019 at 13:07
  • @theworldisnotflat I used 0.92.3 to make this, but the text is on the same layer as the image. Try typing the text on the same layer as the image. If the text is on a separate layer above the image layer, you can also change the blending mode of the text layer to "exclusion" in the layers panel. I tested this, it also works. Also make sure the text is set to a white fill.
    – Billy Kerr
    Feb 12, 2019 at 13:15
  • @theworldisnotflat also can you check you changed the source to "Background" in step 3. It won't work if you forget that.
    – Billy Kerr
    Feb 12, 2019 at 13:23
  • my text was black, ok turned it white but still do not work; tried from a blank new file, add geometric figures, still do not work; tried on the layer of the png, failure; what am i doing wrong? Feb 12, 2019 at 22:04
  • Try the second method I described. Put white text on a layer above the image layer. Then set the blend mode for the text layer to Exclusion. I've just tried it, again and it definitely works.
    – Billy Kerr
    Feb 12, 2019 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.