API Reference

This operation gives you the flexibility to customize the opacity, size and position of the watermark to suit your specific needs.

Parameter structure

To apply the "Watermark" transformation, the URL must be structured as follows:

/watermark:[watermark_url],[optional arguments]/

/watermark:https://example.com/my_wattermark.png/- Apply a watermark with default values

/watermark:https://example.com/my_wattermark.png,opacity:0.5/ - Apply watermark with 50% opacity

/watermark:https://example.com/my_wattermark.png,size:200x300/- Apply watermark with fixed size set

/watermark:https://example.com/my_wattermark.png,size:50p/ - Apply a watermark with a size of 50% of the width of the base image.

/watermark:https://example.com/my_wattermark.png,position:north/ - Apply the watermark in the north position

Optional arguments

  • opacity: Sets the opacity of the watermark, ranging from 0 (totally transparent) to 1 (totally opaque).
    The default value is 1.
  • size: Specifies the size of the watermark. It can be set to specific dimensions (e.g. "200x300"), while maintaining the aspect ratio (e.g. "200x" or "x300") or as a percentage of the size of the base image width (e.g. "50p").
    The default value is 50p
  • position: Determines the position of the watermark on the image. Available values are: north, northeast, east, southeast, south, southwest, west, northwest, and center.
    O valor padrão é "center".

Usage example

To add a watermark with standard opacity and centered position, the URL would be:

https://img.voidr.co/meu_projeto/watermark:https://example.com/minha_marca_dagua.png/fetch/https://images.unsplash.com/photo-1561336313-0bd5e0b27ec8

To add a watermark with 50% opacity, size 600x120 pixels, the URL would be:

https://img.voidr.co/meu_projeto/watermark:https://assets.voidr.co/images/logo-voidr-images.png,opacity:0.5,size:600x120/fetch/https://images.unsplash.com/photo-1561336313-0bd5e0b27ec8

To add a watermark occupying 50% of the original image, with full opacity in the south position, the URL would be:

https://img.voidr.co/meu_projeto/watermark:https://example.com/minha_marca_dagua.png,size:50p,position:south/fetch/https://images.unsplash.com/photo-1561336313-0bd5e0b27ec8>