Image watermarking adds an image as a layer on top of an original image to identify the image or protect its copyright.
Access type
@watermark=1&object=<encodedobject>&t=<transparency>&x=<distanceX>&y=<distanceY>&p=<position>…The watermark and object parameters are required. In this document, `url_safe_base64_encode` refers to URL-safe Base64 encoding. For more information, see Keywords.
Parameters
Name | Description | Parameter type |
object | The name of the watermark image object. The name must be URL-safe Base64 encoded: Note For example, if the object is "panda.png", the encoded content is "cGFuZGEucG5n". | Required |
For information about watermark position parameters, see Basic parameters.
Watermark image pre-processing
You can pre-process a watermark image before you add it. Supported operations include scaling, cropping, and rotation. Inscribed circle cropping or pipeline operations are not supported. For more information about these operations, see the relevant sections of this document. You can also use the `P` parameter, with a value from 1 to 100, to scale the watermark image as a percentage of the main image's size.
Pre-processing example
For example, if you set the `P` parameter to 10, a 100 × 100 main image will have a 10 × 10 watermark. Similarly, a 200 × 200 main image will have a 20 × 20 watermark. The `P` parameter dynamically adjusts the watermark size based on the size of the main image.
Example of a watermark operation: watermark=1&object=cGFuZGEucG5nQDMwUA&t=90&p=9&x=10&y=10. This operation adds a watermark to the lower-right corner. The watermark image is `panda.png@30P`, which means the watermark is scaled to 30% of the main image's size.
Scale the original image to a width of 400 pixels, then add the watermark:

Request format
The `object` parameter must be in the following format: `Original image name (unencoded) + @ + Action`. The entire string must then be URL-safe Base64 encoded.
Examples:
No pre-processing:
object = url_safe_base64_encode("panda.png")Scale to 200%:
object = url_safe_base64_encode("panda.png@200p")Scale to 50%, brightness 50, contrast 40:
object = url_safe_base64_encode("panda.png@50p_50b_40d")Scale to a width of 50, brightness 30:
object = url_safe_base64_encode("panda.png@50w_30b")Scale to a height of 20, contrast 10:
object = url_safe_base64_encode("panda.png@20h_10d")Scale to 20% of the original image size, contrast 10:
object = url_safe_base64_encode("panda.png@20P_10d")
Examples
The following URL adds the watermark file `panda.png` (Base64 encoded: `cGFuZGEucG5n`) to `example.jpg`.

This example scales `panda.png` to a width of 50 pixels. The `object` parameter is created from `panda.png@50w` (Base64 encoded: `cGFuZGEucG5nQDUwdw`).

This example scales `panda.png` to 50% of its original size. The `object` parameter is created from `panda.png@50p` (Base64 encoded: `cGFuZGEucG5nQDUwcA`).

The panda.png file is automatically cropped to 40 in width and 30 in height. The watermark file is identified by `panda.png@40w_20h_1e_1c` (Base64 encoded: `cGFuZGEucG5nQDQwd18yMGhfMWVfMWM`).

This example performs an advanced crop on `panda.png`. It crops a 65 × 65 pixel area starting from the point (0, 0). The `object` parameter is created from `panda.png@0-0-65-65a` (Base64 encoded: `cGFuZGEucG5nQDAtMC02NS02NWE`).

