# Watermark

imgproxy supports the watermarking of processed images using another image.

## Specifying watermark image

There are three ways to specify a watermark image using environment variables:

* `IMGPROXY_WATERMARK_PATH`: the path to the locally stored image
* `IMGPROXY_WATERMARK_URL`: the watermark image URL
* `IMGPROXY_WATERMARK_DATA`: Base64-encoded image data. You can easily calculate it with the following snippet:

  ```bash
  base64 tmp/watermark.webp | tr -d '\n'`.
  ```

You can also specify the base opacity of a watermark using the `IMGPROXY_WATERMARK_OPACITY` environment variable.

:::info
If you're going to use the `scale` argument of `watermark`, it's highly recommended to use SVG, WebP or JPEG watermarks since these formats support scale-on-load.
:::

## Watermarking an image

Use the [watermark](../usage/processing.mdx#watermark) processing option to put a watermark on a processed image:

```imgproxy_url_option
watermark:%opacity:%position:%x_offset:%y_offset:%scale
wm:%opacity:%position:%x_offset:%y_offset:%scale
```

The available arguments are:

* `opacity` - watermark opacity modifier. The final opacity is calculated as `base_opacity * opacity`.
* `position` - (optional) specifies the position of the watermark. Available values:
  * `ce`: (default) center
  * `no`: north (top edge)
  * `so`: south (bottom edge)
  * `ea`: east (right edge)
  * `we`: west (left edge)
  * `noea`: north-east (top-right corner)
  * `nowe`: north-west (top-left corner)
  * `soea`: south-east (bottom-right corner)
  * `sowe`: south-west (bottom-left corner)
  * `re`: repeat and tile the watermark to fill the entire image
* `x_offset`, `y_offset` - (optional) specify watermark offset by X and Y axes. When using `re` position, these values define the spacing between the tiles.
* `scale` - (optional) a floating point number that defines the watermark size relative to the resulting image size. When set to `0` or omitted, the watermark size won't be changed.

## Custom watermarks ((pro)) {#custom-watermarks}

You can use a custom watermark by specifying its URL with the [watermark_url](../usage/processing.mdx#watermark-url) processing option:

```imgproxy_url_option
watermark_url:%url
wmu:%url
```

The value of `url` should be the Base64-encoded URL of the custom watermark.

By default, imgproxy caches 256 custom watermarks with an adaptive replacement cache (ARC). You can change the cache size using the `IMGPROXY_WATERMARKS_CACHE_SIZE` environment variable. When `IMGPROXY_WATERMARKS_CACHE_SIZE` is set to `0`, the cache is disabled.

## Text watermarks ((pro)) {#text-watermarks}

You can put a text as a watermark on your image with the [watermark_text](../usage/processing.mdx#watermark-text) processing option:

```imgproxy_url_option
watermark_text:%text
wmt:%text
```

The value of `text` should be the URL-safe Base64-encoded text of the custom watermark.

By default, the text color is black and the font is `sans 16`. You can use [Pango markup](https://docs.gtk.org/Pango/pango_markup.html) in the `text` value to change the style.

If you want to use a custom font, you need to put it in `/usr/share/fonts` inside a container.

---

## Navigation

- [Getting started](/getting_started)
- [imgproxy Pro](https://imgproxy.net#pro)
- [Installation](/installation)
- [Configuration](/category/configuration)
  - [Configuration options](/configuration/options)
  - [Loading environment variables](/configuration/loading_environment_variables)
- [Usage](/category/usage)
  - [Processing an image](/usage/processing)
  - [Getting an image info](/usage/getting_info)
  - [Signing a URL](/usage/signing_url)
  - [Encrypting a source URL](/usage/encrypting_source_url)
  - [Presets](/usage/presets)
- [Features](/category/features)
  - [Watermark](/features/watermark)
  - [Object detection](/features/object_detection)
  - [Classification](/features/classification)
  - [Autoquality](/features/autoquality)
  - [Best format](/features/best_format)
  - [Chained pipelines](/features/chained_pipelines)
- [Image sources](/category/image-sources)
  - [Serving local files](/image_sources/local_files)
  - [Serving files from Amazon S3](/image_sources/amazon_s3)
  - [Serving files from Google Cloud Storage](/image_sources/google_cloud_storage)
  - [Serving files from Azure Blob Storage](/image_sources/azure_blob_storage)
  - [Serving files from OpenStack Object Storage ("Swift")](/image_sources/openstack_swift)
- [Cache](/category/cache)
  - [External cache](/cache/external)
  - [Internal cache](/cache/internal)
    - [Internal cache: Local filesystem](/cache/internal/local_filesystem)
    - [Internal cache: Amazon S3](/cache/internal/amazon_s3)
    - [Internal cache: Google Cloud Storage](/cache/internal/google_cloud_storage)
    - [Internal cache: Azure Blob Storage](/cache/internal/azure_blob_storage)
    - [Internal cache: OpenStack Object Storage ("Swift")](/cache/internal/openstack_swift)
- [Monitoring](/category/monitoring)
  - [New Relic](/monitoring/new_relic)
  - [Prometheus](/monitoring/prometheus)
  - [Datadog](/monitoring/datadog)
  - [OpenTelemetry](/monitoring/open_telemetry)
  - [Amazon CloudWatch](/monitoring/cloud_watch)
- [Image formats support](/image_formats_support)
- [About the processing pipeline](/about_processing_pipeline)
- [Health check](/healthcheck)
- [Memory usage tweaks](/memory_usage_tweaks)

## Other versions

- [latest (unstable)](/latest/features/watermark)
- [3.31.x](/3.31.x/features/watermark)
- [3.30.x](/3.30.x/features/watermark)
- [3.29.x](/3.29.x/features/watermark)
- [3.28.x](/3.28.x/features/watermark)
- [3.27.x](/3.27.x/features/watermark)
- [3.26.x](/3.26.x/features/watermark)
- [3.25.x](/3.25.x/features/watermark)
- [3.24.x](/3.24.x/features/watermark)
- [3.23.x](/3.23.x/features/watermark)
- [3.22.x](/3.22.x/features/watermark)
- [3.21.x](/3.21.x/features/watermark)
- [3.20.x](/3.20.x/features/watermark)
- [3.19.x](/3.19.x/features/watermark)
