> For the complete documentation index, see [llms.txt](https://docs.cloudimage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudimage.io/transformations/image-watermarking/text-watermark.md).

# Text watermark

If you need to tag an image or add a reference number as an overlay, use the text watermark function.

## Available parameters

| Parameter           | Syntax                                                                                                              | Description                                                                                                                    |       |        |                           |                         |                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----- | ------ | ------------------------- | ----------------------- | ------------------------------------------------- |
| use watermark       | <mark style="color:purple;">**wat=1**</mark>                                                                        | **(required)** Activates the watermark function                                                                                |       |        |                           |                         |                                                   |
| watermark text      | <mark style="color:purple;">**wat\_text=X**</mark>                                                                  | **(required)** The text to be overlayed. Can be URL-encoded                                                                    |       |        |                           |                         |                                                   |
| watermark gravity   | <p><mark style="color:purple;"><strong>wat\_gravity=X</strong></mark><br><code>X=\[north                            | south]\[east                                                                                                                   | west] | center | </code><br><code>absolute | relative</code><br></p> | Defines the position to "anchor" the watermark to |
| watermark padding   | <p><mark style="color:purple;"><strong>wat\_pad=X\[p]\[,Y\[p]]</strong></mark><br><code>X/Y=0..100\[p]</code></p>   | Adds padding from the anchoring point in pixels (**X**) or in percent (**Xp**)                                                 |       |        |                           |                         |                                                   |
| watermark position  | <mark style="color:purple;">**wat\_pos=X\[,Y]**</mark>                                                              | <p>sets the position in percent from the resized image; works only with<br>wat\_gravity=absolute and wat\_gravity=relative</p> |       |        |                           |                         |                                                   |
| watermark opacity   | <p><mark style="color:purple;"><strong>wat\_opacity=X</strong></mark><br><code>X=0..1</code></p>                    | Defines watermark opacity                                                                                                      |       |        |                           |                         |                                                   |
| watermark font      | <mark style="color:purple;">**wat\_font=X**</mark>                                                                  | Choose the font family for the overlay                                                                                         |       |        |                           |                         |                                                   |
| watermark color     | <mark style="color:purple;">**wat\_color=X**</mark> \| <mark style="color:purple;">**wat\_colour=X**</mark>         | Sets the text color                                                                                                            |       |        |                           |                         |                                                   |
| watermark font size | <mark style="color:purple;">**wat\_fontsize=X**</mark> \| <mark style="color:purple;">**wat\_fontsize=Xmax**</mark> | Sets the font size. If the Xmax syntax is used, the size is reduced if the text cannot fit in the image                        |       |        |                           |                         |                                                   |

## Examples

| Preview                          | Syntax                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/rlHWbplq18DCrLNUh9FS) | [/samples.scaleflex.com/flat1.jpg?<mark style="color:orange;">**w=550**</mark>&<mark style="color:purple;">**wat=1**</mark>&<mark style="color:purple;">**wat\_gravity=northeast**</mark>&<mark style="color:purple;">**wat\_text=REF00189300B**</mark>&<mark style="color:purple;">**wat\_pad=10**</mark>&<mark style="color:purple;">**wat\_font=Arial-Black**</mark>&<mark style="color:purple;">**wat\_fontsize=18**</mark>&<mark style="color:purple;">**wat\_color=660000**</mark>](https://doc.cloudimg.io/https://samples.scaleflex.com/flat1.jpg?w=550\&wat=1\&wat_gravity=northeast\&wat_text=REF00189300B\&wat_pad=10\&wat_font=Arial-Black\&wat_fontsize=18\&wat_color=660000)                                                                                                                                                                                                                                                                    |
| ![](/files/oLkbCr89BDppZ9U5u5be) | <p>Text too long for the image:<br><a href="https://doc.cloudimg.io/https://samples.scaleflex.com/flat1.jpg?w=400&#x26;wat=1&#x26;wat_gravity=north&#x26;wat_text=A%20VERY%20LONG%20TEXT%20WHICH%20WON%27T%20FIT&#x26;wat_pad=10&#x26;wat_font=Arial-Black&#x26;wat_fontsize=20&#x26;wat_color=000">/samples.scaleflex.com/flat1.jpg?<mark style="color:orange;"><strong>w=400</strong></mark>&<mark style="color:purple;"><strong>wat=1</strong></mark>&<mark style="color:purple;"><strong>wat\_gravity=north</strong></mark>&<mark style="color:purple;"><strong>wat\_text=A%20VERY%20LONG%20TEXT%20WHICH%20WON%27T%20FIT</strong></mark>&<mark style="color:purple;"><strong>wat\_pad=10</strong></mark>&<mark style="color:purple;"><strong>wat\_font=Arial-Black</strong></mark>&<mark style="color:purple;"><strong>wat\_fontsize=20</strong></mark>&<mark style="color:purple;"><strong>wat\_color=000</strong></mark></a></p>                        |
| ![](/files/J8DSCs0U0AAw4gfmoBB3) | <p>Text size limit set with wat\_fontsize=20max:<br><a href="https://doc.cloudimg.io/https://samples.scaleflex.com/flat1.jpg?w=400&#x26;wat=1&#x26;wat_gravity=north&#x26;wat_text=A%20VERY%20LONG%20TEXT%20WHICH%20WON%27T%20FIT&#x26;wat_pad=10&#x26;wat_font=Arial-Black&#x26;wat_fontsize=20max&#x26;wat_color=000">/samples.scaleflex.com/flat1.jpg?<mark style="color:orange;"><strong>w=400</strong></mark>&<mark style="color:purple;"><strong>wat=1</strong></mark>&<mark style="color:purple;"><strong>wat\_gravity=north</strong></mark>&<mark style="color:purple;"><strong>wat\_text=A%20VERY%20LONG%20TEXT%20WHICH%20WON%27T%20FIT</strong></mark>&<mark style="color:purple;"><strong>wat\_pad=10</strong></mark>&<mark style="color:purple;"><strong>wat\_font=Arial-Black</strong></mark>&<mark style="color:purple;"><strong>wat\_fontsize=20max</strong></mark>&<mark style="color:purple;"><strong>wat\_color=000</strong></mark></a></p> |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloudimage.io/transformations/image-watermarking/text-watermark.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
