What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Pillow to draw watermark text on a transparent RGBA layer, composite that layer over your screenshot, and save the result to a new file. This keeps the original intact and makes translucent text straightforward. The example below places the text in the bottom-right corner; you can adapt it for a logo or another position.

Install Pillow and choose a font

Pillow provides the image and drawing APIs used here. Install it in the Python environment that will run the script:

python -m pip install Pillow

The example uses a TrueType font file, which gives control over size and appearance. You must supply a font path that exists on your machine; font locations vary across operating systems. Pillow documents bitmap and TrueType/OpenType font support in its ImageFont reference. If the selected build lacks required support or the path is wrong, loading the font will fail.

Add a translucent text watermark

Save this as watermark.py. Put the screenshot and a font file at the paths you specify, or change the paths to match your setup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from pathlib import Path
from PIL import Image, ImageDraw, ImageFont

input_path = Path("screenshot.png")
output_path = Path("screenshot_watermarked.png")
font_path = Path("DejaVuSans.ttf")
watermark = "Example watermark"

with Image.open(input_path) as opened:
    base = opened.convert("RGBA")
    width, height = base.size

    # Scale the font and inset to the image dimensions, with a minimum size.
    font_size = max(16, width // 40)
    margin = max(12, width // 50)
    font = ImageFont.truetype(str(font_path), size=font_size)

    # Draw on its own transparent layer so the text alpha is retained.
    layer = Image.new("RGBA", base.size, (0, 0, 0, 0))
    draw = ImageDraw.Draw(layer)
    box = draw.textbbox((0, 0), watermark, font=font)
    text_width = box[2] - box[0]
    text_height = box[3] - box[1]

    # Keep the measured text inside the image, even when it is unusually long.
    if text_width + 2 * margin > width or text_height + 2 * margin > height:
        raise ValueError("Watermark does not fit; use shorter text, a smaller font, or a smaller margin")

    x = width - margin - text_width - box[0]
    y = height - margin - text_height - box[1]
    draw.text((x, y), watermark, font=font, fill=(255, 255, 255, 150))

    result = Image.alpha_composite(base, layer)
    result.save(output_path)

print(f"Saved watermarked screenshot to {output_path}")

Change input_path, output_path, font_path, and watermark to suit your files. The output uses a separate path so the source screenshot remains available.

Why the transparent layer matters

The base is converted to RGBA, then a same-size transparent RGBA layer receives the text. The fill tuple (255, 255, 255, 150) means white with partial alpha; lower alpha makes the mark more transparent, while 255 is fully opaque. Compositing combines that layer with the image. Drawing with an RGB fill directly onto an RGB image does not apply alpha as a transparency setting. Pillow demonstrates drawing partial-opacity text on a transparent layer and compositing it in the ImageDraw reference.

How placement and sizing work

Pillow image coordinates begin at the upper-left. The code measures the rendered text using textbbox and calculates its bottom-right position with an inset margin. Drawing outside the image is discarded, so measuring the text and keeping it within bounds avoids accidental clipping. The font size and margin are based on image width, with minimums so small screenshots do not produce tiny values; very small images may still need a smaller font and margin.

Choose a useful watermark style

Text, logo, or both

Text works well for a copyright notice, owner name, draft status, or internal-use label. For a logo, open the logo image, convert it to RGBA, and paste it onto a transparent layer using its alpha channel as the mask. Then composite that layer over the base in the same way as the text example. Keep a logo’s aspect ratio and size it to fit before positioning; a large opaque logo can obscure details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Corner, center, or repeated placement

A corner mark is easy to read and usually leaves most of the screenshot unobstructed. A center mark is harder to crop out but covers more content. A repeated diagonal pattern can deter reuse more effectively, but it is also the most visually intrusive and requires rotating or drawing several marks on the overlay. In every case, keep measured bounds inside the image; portions outside the canvas will not appear.

Relative versus fixed sizing

The sample derives the font size from image width, so screenshots at different resolutions receive a proportionate mark. If all outputs have a known size, a fixed pixel value may be more predictable. For a batch containing highly varied image dimensions, consider calculating font size and margins independently for each image and imposing both minimum and maximum values.

Handle long text and command-line inputs

Long watermark text can exceed the available width even when the font size is proportional. The script checks the measured bounds and stops with an actionable error instead of silently clipping the mark. For more control, shorten the text, reduce the size, wrap it across lines, or position it elsewhere. If you wrap text, measure the resulting multiline block and test its final bounds before drawing.

For repeated use, expose paths, text, opacity, font, and size as command-line options rather than editing source constants. Python’s argparse module supports command-line options and arguments; see the Python 3.11 argparse documentation. A useful interface might accept --input, --output, --text, --font, --size, and --opacity. Validate that opacity is between 0 and 255 and that the font and input paths exist before processing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Save the image in the format you need

The example saves as PNG, which preserves the composited pixels and is suitable for screenshots. If saving JPEG, use an output filename ending in .jpg or .jpeg; JPEG does not preserve transparency, and the result will be flattened. You may need to convert to RGB before saving JPEG, especially if the source image has an alpha channel. Keep the original input untouched by choosing a distinct output name.

Troubleshooting

  • Font file not found: Set font_path to a real font file available on the machine. Font paths are not portable by default; include or install a suitable font as appropriate for your environment.
  • TrueType font loading fails: Confirm that the Pillow build supports the required font functionality and that the file is a supported TrueType/OpenType font. A default bitmap font can be a portability fallback when typographic control is not essential.
  • Watermark is invisible: Increase the alpha value, choose a contrasting color, and verify the text lies within the measured bounds. A watermark can blend into a similarly colored region even when drawn correctly.
  • Text is clipped or the fit check fails: Reduce the font size or margin, shorten the watermark, or reposition it. Pillow uses an upper-left coordinate origin, and out-of-bounds pixels are discarded.
  • Transparency appears ignored: Draw using an RGBA fill on a transparent RGBA overlay and composite it with the base. An RGB drawing operation does not make the fill alpha behave like layer transparency.
  • Output cannot be saved in the desired format: Match the filename extension to the format and convert the image mode if required. For JPEG, convert to RGB because JPEG cannot store an alpha channel.

Performance and batch processing

For one screenshot, this workflow is simple: it opens the image, allocates an overlay the same size, composites it, and writes a new file. The overlay requires memory proportional to image dimensions, so very large screenshots and large batches can use substantial memory. Process a batch one image at a time, close each opened image, and write each result to a distinct destination. Avoid overwriting the input unless you have a backup and specifically intend to replace it.

For repeatable results, record the chosen font file, size rule, color, opacity, and placement alongside your script. Text rendering can differ with font files, so using the same font consistently is important when screenshots need a uniform watermark.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you still need to capture the website before marking up its screenshot, ScreenshotNeo is a website screenshot API and MCP server. It accepts one GET request with a URL and returns a screenshot or PDF. The following cURL call saves a WebP capture of Stripe; replace the URL and API key for your use. See the ScreenshotNeo API documentation for request options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be switched off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for free: 1,000 screenshots a month, no card required.

Frequently Asked Questions

Does Pillow apply text transparency when drawing directly on an RGB image?

No. Use an RGBA overlay and alpha-composite it with the image.

Can I use a logo instead of text?

Yes. Load the logo with its alpha channel, position it on a transparent layer, and composite the layer over the screenshot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.