GET
/
transform

How to use

The watermark transformation allows you to add a watermark image to your main image with various positioning and sizing options.

Pass the following query param to the API endpoint:

watermark=image,x,y,alpha[,w_ratio[,h_ratio]]

Where:

  • image: The URI of the watermark image (using the same image loader configured for imagor)
  • x: Horizontal position of the watermark
  • y: Vertical position of the watermark
  • alpha: Transparency of the watermark (0-100)
  • w_ratio: (Optional) Width ratio of the watermark relative to the main image
  • h_ratio: (Optional) Height ratio of the watermark relative to the main image

For example: watermark=https://www.thunderimage.com/sample/watermark.png,right,bottom,50,10,10

Parameters

  1. image: The URI of the watermark image.

  2. x: Horizontal position of the watermark. Can be:

    • Positive number: Distance from the left
    • Negative number: Distance from the right
    • Number followed by ‘p’ (e.g., ‘20p’): Percentage of the image width
    • ‘left’, ‘right’, ‘center’: Preset positions
    • ‘repeat’: Repeats the watermark horizontally
  3. y: Vertical position of the watermark. Can be:

    • Positive number: Distance from the top
    • Negative number: Distance from the bottom
    • Number followed by ‘p’ (e.g., ‘20p’): Percentage of the image height
    • ‘top’, ‘bottom’, ‘center’: Preset positions
    • ‘repeat’: Repeats the watermark vertically
  4. alpha: Watermark transparency. Range: 0 (fully opaque) to 100 (fully transparent).

  5. w_ratio: (Optional) Percentage of the main image width that the watermark should fit within.

  6. h_ratio: (Optional) Percentage of the main image height that the watermark should fit within.

Effect of Watermarking

  • Overlays the specified watermark image onto the main image.
  • Allows precise positioning of the watermark.
  • Can adjust the watermark’s size relative to the main image.
  • Provides control over the watermark’s transparency.

This transformation is useful for adding branding, copyright notices, or other identifying marks to images.

Original Image

URL : https://www.thunderimage.com/sample/yosemite.jpg

Image with Watermark

URL: /transform?url=https://www.thunderimage.com/sample/yosemite.jpg&watermark=https://www.thunderimage.com/sample/watermark.png,repeat,repeat,50,10,10

Best Practices

  • Choose a watermark image with transparency (e.g., PNG with alpha channel) for better integration with various backgrounds.
  • Use appropriate alpha values to ensure the watermark is visible but not overly distracting.
  • Consider the content of your main image when positioning the watermark to avoid covering important elements.
  • When using percentage-based positioning, remember that it’s relative to the image dimensions.
  • Test your watermark on various image sizes to ensure it scales appropriately.
  • For repeated watermarks, choose a small, simple design that works well in a pattern.

Note

The watermark image must be accessible via the URL provided. Ensure that the watermark image is hosted on a reliable server with appropriate permissions.

Authorizations

x-api-key
string
headerrequired

API key required for authentication

Query Parameters

url
string
required

The URL of the image to be transformed.

watermark
string

Parameters for adding a watermark to the image. Format: image,x,y,alpha[,w_ratio[,h_ratio]]

Response

200 - image/jpeg

The transformed image in JPEG format.