โ† Back to blog

How to Add Watermarks to Images with curl or Python (Free API)

July 24, 2026 ยท Eric ยท 6 min read

Product photos stolen. Blog images reposted without credit. Client deliverables ripped and resold. If you publish images on the web, you've either dealt with unauthorized reuse or you will.

Watermarks are the simplest deterrent โ€” a semi-transparent "ยฉ Your Brand" stamped across your work. But doing it manually in Photoshop for every image doesn't scale. Building a server-side Sharp pipeline from scratch is overkill for what should be a POST request.

This guide walks through the Agent Media Tools watermark API โ€” one endpoint that takes a public image URL and your text, returns a watermarked version. No signup for basic use, no servers to deploy, no image processing libraries to install.

What the Watermark API Does

The watermark_image endpoint takes four inputs and returns a processed image:

ParameterTypeDescription
image_urlURL (required)Public URL of the source image
textstring (required)Watermark text to overlay
positionenumOne of: bottom-right, bottom-left, top-right, top-left, center. Default: bottom-right
opacityfloat 0.1โ€“1How visible the watermark is. Lower = more subtle. Default: 0.5

The API processes the image server-side and returns the watermarked result as an image download โ€” you save it, display it, or pass it to the next step in your pipeline.

One-Line Watermark with curl

The fastest way to try it:

curl -X POST https://agentmediatools.com/api/tools/watermark \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/photo.jpg",
    "text": "ยฉ Agent Media Tools",
    "position": "bottom-right",
    "opacity": 0.6
  }' \
  --output watermarked.jpg

That's it. One command. The response is the image itself โ€” raw binary, ready to save. No JSON wrapper, no base64 decoding, no extra steps.

If you want to see what it does with minimal effort, try it on any public image:

curl -s -X POST https://agentmediatools.com/api/tools/watermark \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
    "text": "SAMPLE",
    "position": "center",
    "opacity": 0.3
  }' \
  --output demo-watermarked.png

Watermarking in Python

For batch jobs, use Python with requests:

import requests

def watermark_image(image_url, text, position="bottom-right", opacity=0.5):
    """Add a text watermark to an image and return the bytes."""
    resp = requests.post(
        "https://agentmediatools.com/api/tools/watermark",
        json={
            "image_url": image_url,
            "text": text,
            "position": position,
            "opacity": opacity,
        },
    )
    resp.raise_for_status()
    return resp.content

# Single image
bytes_out = watermark_image(
    "https://example.com/portfolio.jpg",
    "ยฉ Jane Doe Photography",
    position="bottom-left",
    opacity=0.4,
)
with open("portfolio-watermarked.jpg", "wb") as f:
    f.write(bytes_out)

Batch Watermark an Entire Directory

Where this really shines is processing a folder of images without looping through local PIL or Sharp calls:

import os
import requests

def watermark_batch(image_urls, text, position="bottom-right", opacity=0.5, out_dir="output"):
    os.makedirs(out_dir, exist_ok=True)
    for url in image_urls:
        filename = os.path.basename(url.split("?")[0]) or "image.jpg"
        out_path = os.path.join(out_dir, filename)

        resp = requests.post(
            "https://agentmediatools.com/api/tools/watermark",
            json={"image_url": url, "text": text, "position": position, "opacity": opacity},
        )
        if resp.status_code == 200:
            with open(out_path, "wb") as f:
                f.write(resp.content)
            print(f"โœ“ {filename} โ†’ {out_path}")
        else:
            print(f"โœ— {filename} failed ({resp.status_code})")

# Example: watermark a gallery
gallery = [
    "https://your-cdn.com/gallery/sunset.jpg",
    "https://your-cdn.com/gallery/portrait.jpg",
    "https://your-cdn.com/gallery/landscape.jpg",
]
watermark_batch(gallery, "ยฉ YourBrand 2026", opacity=0.4)

This pattern works for any number of images โ€” just feed the URLs and let the API handle the processing on the server side. Your machine only does HTTP requests and file writes.

Positioning & Opacity โ€” Choosing the Right Settings

Watermark placement matters for both aesthetics and theft deterrence:

PositionBest forNotes
bottom-rightDefault. Portraits, general photographyEasy to crop out if someone's determined
centerPreview images, social media cardsHardest to remove, most intrusive
top-leftProduct photos on white backgroundsVisible above fold, less common = less targeted
bottom-leftHorizontal compositionsBalances right-side visual weight
top-rightImages with text overlays already on bottomAvatars and profile images

Opacity is a trade-off. 0.3โ€“0.5 is the sweet spot โ€” visible enough to claim ownership, transparent enough not to ruin the image. Below 0.2 becomes invisible to most viewers. Above 0.8 dominates the photo.

If you're watermarking images for client proofs, use center at 0.5โ€“0.7. For public social media posts, bottom-right at 0.3โ€“0.4 works better โ€” it's there if someone looks, but doesn't distract from the content.

Using the Watermark API from an AI Agent (MCP)

If you run a Claude Desktop or any MCP-compatible agent, the watermark tool is available directly. Once connected, your agent can watermark images as part of larger workflows โ€” for example:

Example Agent Task

"Take the latest screenshots from my website, watermark them with 'ยฉ MyBrand 2026' in the bottom-right at 40% opacity, and upload them to the artifact store."

The agent chains the screenshot_page โ†’ watermark_image โ†’ create_artifact tools automatically. No code to write. If you've already set up the MCP server, this works out of the box.

For custom agent frameworks, the MCP tool definition looks like:

{
  "name": "watermark_image",
  "description": "Add a text watermark overlay to an image",
  "parameters": {
    "image_url": "https://...",
    "text": "ยฉ 2026 Your Brand",
    "position": "bottom-right",
    "opacity": 0.5
  }
}

Real-World Use Cases

Here are a few patterns we've seen people build with this API:

1. E-commerce Product Photography Pipeline

Photographers upload raw shots to a CDN. A cron job or serverless function fetches each new URL, watermarks it with "ยฉ StoreName", and saves the result back to a watermarked subdirectory. The team only manages the raw uploads โ€” watermarks are automated.

2. Blog Image Protection for Ghost / WordPress

A small Node.js middleware hooks into the image upload webhook, passes the new image URL through the watermark API, and replaces the stored version. Writers never think about watermarks โ€” they just happen.

3. Client Proof Galleries

Photographers build a gallery page where each thumbnail is watermarked with center at 0.6 opacity. Full-resolution originals stay private. When the client pays, the watermark-free originals are delivered.

4. Social Media Repost Protection

An AI agent monitors your Instagram feed, downloads each new post, watermarks it with your handle, and archives it. If a repost surfaces without credit, you have a watermarked timestamped original.

Limits & Pricing

The watermark endpoint is available on the Free tier โ€” no API key required for basic use. Free tier includes daily rate limits suitable for personal projects and light automation.

For bulk processing (thousands of images), the Pro tier at $15/month raises limits significantly, adds priority processing, and unlocks API key access with usage tracking.

No hidden overage charges. All paid tiers have hard caps โ€” you'll never get a surprise bill.

Try it right now. Paste the curl command above with your own image URL. No signup, no credit card, no account creation.

Try the Watermark API โ†’

Comparison: This vs. Building It Yourself

ApproachTime to first watermarkOngoing maintenanceScales to
Manual (Photoshop/GIMP)30 seconds per imageManual every time10s of images
Local Sharp/PIL script1โ€“2 hours (install + debug)Library updates, font paths1000s of images
Agent Media Tools API1 curl commandZeroUnlimited (tiered)
Dedicated SaaS10 min (signup + API)Vendor managementDepends on plan

The API approach wins on speed and zero maintenance. The only trade-off: your source image must be publicly accessible (a URL the server can fetch). For local files, upload them to any temporary hosting (S3, Imgur, Dropbox public link) and pass the URL.

What's Next

The watermark API is one of 40+ tools available through Agent Media Tools. If you're building image processing pipelines, you'll also be interested in:

All available from the same API. No additional accounts needed.


Agent Media Tools provides free and paid APIs for image processing, PDF manipulation, QR codes, web utilities, and AI agent tools. Visit the homepage to explore all available tools. Have questions? Join the Discord.