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.
The first step is to create our watermark image. For this, we’ll use the upload
endpoint.
Upload an image to the API
First, download the image you want to use as a watermark. Here we’ll use the IMG Processing logo.
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.
This will return an image object with the watermark image.
Now, we have our watermark image created, and we can apply it to an 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:
This will return an image object with the image we want to apply the watermark to.
Now, we have our watermark image and our image created, and we can apply the watermark to the image.
To apply the watermark to the image, we’ll use the watermark
endpoint.
Apply a watermark to an image
As parameters, we need to send the image id of the image we want to apply the watermark to.
As body, we need to send the watermark image inside the watermarks
array.
Here is an example request:
This will return an image object with the watermark applied to the image.
Now, we have our image with the watermark applied to it, and we can download it using the download
endpoint.
Download an image
This will download the image to your computer.
You can try this on the Postman collection.
Try it yourself on the Postman Collection
Now that you know how to apply a watermark to an image, you can learn how to do other things with the API.