> ## Documentation Index
> Fetch the complete documentation index at: https://docs.img-processing.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Watermark Image

> Apply a watermark to an image.

IMG Processing allows you to apply watermarks to images. This is useful for adding a logo or a text to an image, or for adding a
copyright notice.

Despite the name, watermarks are just overlay images that are placed on top of the original image, making more flexible
than traditional watermarks.

In this guide, we'll see how to apply a watermark to an image using the API.

## Uploading our Watermark

The first step is to create our watermark image. For this, we'll use the `upload` endpoint.

<Card title="Upload an Image" icon="upload" href="/api-reference/endpoints/creation/upload" horizontal>
  Upload an image to the API
</Card>

First, download the image you want to use as a watermark. Here we'll use the IMG Processing logo.

<img src="https://mintcdn.com/imgprocessing/96najFJQ0rXKRJFY/logo/logo.png?fit=max&auto=format&n=96najFJQ0rXKRJFY&q=85&s=1b02fc935abd127d4c9f191f6fae5a90" alt="IMG Processing Logo" class="rounded-lg" width="1515" height="1505" data-path="logo/logo.png" />

Then, copy your api key on the dashboard and replace it on the `x-api-key` field, and replace the `image` field with the path to the image you want to use as a watermark.

```bash theme={null}
curl -X POST "https://api.img-processing.com/v1/images" \
     -H "x-api-key: YOUR_API_KEY" \
     -F "image=@logo.png" \
     -F "name=watermark-logo"
```

This will return an image object with the watermark image.

```json theme={null}
{
    "id":"image_za9vcdw6yajjyg77v5kkf3bn",
    "name":"watermark-logo",
    "url":null,
    "width":1515,
    "height":1505,
    "format":"png",
    "size":1939304,
    "created_at":"2025-04-01T16:52:32.503Z"
}
```

Now, we have our watermark image created, and we can apply it to an image.

## Uploading our Image

The next step is to upload the image we want to apply the watermark to. For this, we'll use the `upload` endpoint again.

This time, we'll use the following image:

<img src="https://mintcdn.com/imgprocessing/96najFJQ0rXKRJFY/images/cat2.png?fit=max&auto=format&n=96najFJQ0rXKRJFY&q=85&s=16e40b15afa982c051d6e05b9833a2e3" alt="Example Image" class="rounded-lg" width="1024" height="1024" data-path="images/cat2.png" />

```bash theme={null}
curl -X POST "https://api.img-processing.com/v1/images" \
     -H "x-api-key: YOUR_API_KEY" \
     -F "image=@cat2.png" \
     -F "name=cat-image"
```

This will return an image object with the image we want to apply the watermark to.

```json theme={null}
{
    "id":"image_iv7d1rish0ymrmk7qwuht3ap",
    "name":"cat-image",
    "url":null,
    "width":1024,
    "height":1024,
    "format":"png",
    "size":1427326,
    "created_at":"2025-04-01T16:15:44.212Z"
}
```

Now, we have our watermark image and our image created, and we can apply the watermark to the image.

## Applying the Watermark

To apply the watermark to the image, we'll use the `watermark` endpoint.

<Card title="Watermark Image" icon="stamp" href="/api-reference/endpoints/multi-image/watermark" horizontal>
  Apply a watermark to an image
</Card>

As parameters, we need to send the image id of the image we want to apply the watermark to.

```
https://api.img-processing.com/v1/images/{imageId}/watermark
```

As body, we need to send the watermark image inside the `watermarks` array.

```json theme={null}
{
    "watermarks": [
        {
            "id": "image_za9vcdw6yajjyg77v5kkf3bn",
            "top": 100,
            "left": 100,
            "width": 200,
            "height": 200
        }
    ]
}
```

Here is an example request:

```bash theme={null}
curl -X POST "https://api.img-processing.com/v1/images/image_iv7d1rish0ymrmk7qwuht3ap/watermark" \
     -H "x-api-key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
        "watermarks": [
            {
                "id": "image_za9vcdw6yajjyg77v5kkf3bn",
                "top": 100,
                "left": 100,
                "width": 200,
                "height": 200
            }
        ]
    }'
```

This will return an image object with the watermark applied to the image.

```json theme={null}
{
    "id":"image_idl1ad5ppzbq65qohwbtcdjc",
    "name":"cat-image",
    "url":null,
    "width":1024,
    "height":1024,
    "format":"png",
    "size":1430284,
    "created_at":"2025-04-01T17:02:58.496Z"
}
```

## Downloading the Image

Now, we have our image with the watermark applied to it, and we can download it using the `download` endpoint.

<Card title="Download an Image" icon="download" href="/api-reference/endpoints/download" horizontal>
  Download an image
</Card>

```bash theme={null}
curl -X GET "https://api.img-processing.com/v1/images/YOUR_IMAGE_ID/download" \
     -H "x-api-key: YOUR_API_KEY" \
     -o "cat-image-removed-background.png"
```

This will download the image to your computer.

<img src="https://mintcdn.com/imgprocessing/96najFJQ0rXKRJFY/images/cat2-watermark.png?fit=max&auto=format&n=96najFJQ0rXKRJFY&q=85&s=0f74f41eaa230fba5e442b5b58e76fa9" alt="Watermarked Image" class="rounded-lg" width="1024" height="1024" data-path="images/cat2-watermark.png" />

## Try it yourself

You can try this on the Postman collection.

<Card title="Postman Collection" icon="flask" href="https://app.getpostman.com/run-collection/6263667-a1fd2c1b-fe7b-4a05-87c1-6e0172caa20c?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D6263667-a1fd2c1b-fe7b-4a05-87c1-6e0172caa20c%26entityType%3Dcollection%26workspaceId%3D845670a4-96fc-43cb-8204-4cff32ab67f2#?env%5BAPI%5D=W3sia2V5IjoiaG9zdCIsInZhbHVlIjoiaHR0cHM6Ly9hcGkuaW1nLXByb2Nlc3NpbmcuY29tIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQiLCJzZXNzaW9uVmFsdWUiOiJodHRwczovL2Rldi1hcGkuaW1nLXByb2Nlc3NpbmcuY29tIiwic2Vzc2lvbkluZGV4IjowfSx7ImtleSI6ImFwaWtleSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6InNlY3JldCIsInNlc3Npb25WYWx1ZSI6ImxpdmVfYWo0ZXVvZjV5OTJ0YzRweGxwZjg5bDlwdWhxYXlla2IiLCJzZXNzaW9uSW5kZXgiOjF9LHsia2V5IjoiaW1hZ2VfaWQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJhbnkiLCJzZXNzaW9uVmFsdWUiOiJpbWFnZV9qbGp0eXdmMGlodmJxcnRkMHYyNGEzd20iLCJzZXNzaW9uSW5kZXgiOjJ9XQ==" horizontal>
  Try it yourself on the Postman Collection
</Card>

## Keep Learning

Now that you know how to apply a watermark to an image, you can learn how to do other things with the API.

* [Set a repetition mode to the watermark](/api-reference/endpoints/multi-image/watermark#param-repetition-mode) to make the watermark repeat across the image.
