Watermark file with SVG - Krzysiu/krzysiu-gimp-plugin-pack GitHub Wiki

This plugin watermarks image with SVG file. The size of watermark and margins depends on the image size. This way you can watermark many different images without changing the settings. The plugin adds watermark as separate layer, so the opacity and/or blending mode can be tuned later.

Result

Bottom-right corner, 30% of image size, 1% margin, 60% opacity
Example #1

Inverted colors, top-left corner, 8% of image size, 3% margin, 22% opacity
Example #2

The watermark file recommendations

The watermark file have to be an SVG file which Gimp can open. Such file can be created using open source editor with native SVG support - Inkscape. The watermark file needs to fit certain requirements:

  • transparent background
  • no margins (Inkscape: File>Document Properties...>Resize page to content...>Resize page to drawing or selection)
  • for "Watermark color" option: dark version
  • New feature second, light version with the same file name, but with -light suffix (for e.g. if your watermark file is c:\foo\bar.svg, then light version should be c:\foo\bar-light.svg - if light version won't be provided, plugin will simply invert colors.
  • the size of the watermark should be minimally as large as the largest rendered watermark
    Example: if the biggest image we watermark is 10 000 px wide and the biggest watermark we use is 20%, the vector drawing width have to be at least 2000 px wide
  • preferably opaque, as plugin handles opacity by itself

Setting the default watermark file

There are a few ways to choose the watermark file.

  1. By default the plugin excepts file named watermark-image.svg located in the same directory, as the plugin file (watermark-image.py). Rename your watermark file to fit the default path.
  2. Run plugin, choose the proper file and select option "Set this file as default". After restarting Gimp, the plugin will use this file by default.
    The alternative, manual way: create file watermark-image.ini in the plugin directory. The only content of the file should be a path to the watermark file.

Options

  • Watermark file - path to SVG file with watermark
  • Set this file as default - if set, the chosen watermark file path will be set as default. To apply it, restart Gimp. Remember to unset this option if you are going to repeat filter.
  • Watermark width (% of image) - size of the watermark relative to watermarked image
  • Margin (% of image) - margin from the border relative to watermarked image
  • Position - the corner where the watermark will be placed
  • Blending mode - blending mode (layer mode) for blending watermark. Usually overlay (with 100% opacity and if needed duplicating watermark) produces good results. All modes are available, except legacy.
  • Opacity (%) - opacity of the watermark
  • New feature Watermark color - if watermark is black (as per the watermark file recommendations section), you can use
    • Dark - in other words given/original file
    • New feature Light - if there's file with suffix -light (see The watermark file recommendations for example), use it, if not, invert colors
    • Auto for crude and kind of slow autodetection but with rather good results - it will make watermark light version for dark backgrounds and dark for light

Color setting with additional file (with -light suffix):

Color setting with additional file (with -light suffix):

Color setting without additional file (old style)

Color setting without additional file (old style)

Known issues

If you encounter problems with watermark, just open it in Gimp to see how Gimp renders it. For compatibility reasons it's a good practice to convert text and strokes to path. The latter is needed only if you use stroke style with caps (like arrows).

The plugin will crash if:

  • file watermark-image.ini exists, but it cannot be read
  • "Set this file as default" is on, but watermark-image.ini can't be written
⚠️ **GitHub.com Fallback** ⚠️