Raster Image - Watermark

From RealWorld Wiki

Jump to: navigation, search

The Watermark operation is an operation plug-in, which works with raster images and adds a specified image or a text to the original image.

The placement of the added object is specified in percents. Setting the values to 0% will put the watermark in top/left corner while setting it to 100% will place it in the bottom/right corner. It is also possible to add a margin (specified in pixels) to the object and the margin is considered part of the object changing its native size.

The watermark can be either text or image. In any case it is possible to set a master transparency value. If the watermark is to be an image, it is necessary to specify a full path that image in the configuration. In case of text watermark, there are many more options.

Text watermarks use selected font, they can be italic and/or bold and shadow can be placed under the text to make it more legible (the shadow will be either balkc or white depending on the color of the letters). The text can also be rotated by any angle in range -180 to 180 degrees. Finally, the size of the used font can either be specified in pixels or it may be automatically computed as percentage of the image size.

The watermarked text can consist of multiple lines with given alignment and the placeholders can be used:

  •  %% - prints a single % sign
  •  %FILENAME% - name of the processed image without extension ("filename" if unavailable)
  •  %FILEFOLDER% - path to the folder with processed image with trailing / ("folder/" if unavailable)
  •  %FILEEXT% - extension of the processed image ("ext" if unavailable)
  •  %FILEPATH% - full path (including folder, name and extenaison) to the processed image ("fullpath" if unavailable)
  •  %EXIF-TagName% - value of an EXIF tag as text (empty string if tag is unavailable); for example using %EXIF-Model% will print the name of the digital camera used to shoot the image, for example "NIKON D50".

If more flexibility is needed, it is possible to used the JavaScript operation and call the Watermark filter from there with parameters computed on the fly.

[edit] Internals

GUID: B840563F-6365-40EB-9438-1F84DB5B808F

Configuration
Parameter nameTypeDefaultValueNote
PosXinteger1000-100%horizontal position
PosYinteger1000-100%vertical position
Marginsinteger10pixels
Opacityinteger1000-100%0=completely transparent
Typeinteger00=text, 1=image
Imagestring""path to the watermark imageonly used if Type is 1
Textstring"%FILENAME%"only used if Type is 0
Fontstring"Arial"only used if Type is 0
Colorinteger0x68e0e8RGB in 8bit hexadecimal (web) formatonly used if Type is 0
Boldboolfalseonly used if Type is 0
Italicboolfalseonly used if Type is 0
Shadowboolfalseonly used if Type is 0
Angleinteger0-180 to 180 degreesonly used if Type is 0
Alignmentinteger20=left, 1=center, 2=rightonly used if Type is 0
SizeTypeinteger00=absolute, 1=relativeonly used if Type is 0
AbsSizeinteger16pixelsonly used if Type is 0 and SizeType is 0
RelSizefloat2.0%only used if Type is 0 and SizeType is 1
Personal tools