Search code examples
imageresizer

Imageresizer - watermark opacity


We need to apply watermarks, both image and text with an opacity applied.

It seems from the documentation that this is possible for images, but it doesn't seem to work.

imageQuery="filter=alpha(0.5)"

And there appears to be no option for text watermarks. Am I missing something as I would have thought this would be a common requirement for watermarking.

Here is an example of what we are trying to achieve: https://i.sstatic.net/nE7r7.jpg


Solution

  • Text layers can have an 8-digit color specifier. Opacity is the last two digits. I.e, FFFFFF99 would be a partially tansparent white.

    <watermarks>
      <text name="test2" text="Hello #{name}!" 
       vertical="true" align="topright" color="FFFFFF99" />
    </watermarks>