Never watermark your images manually again!! (use just a few lines of python)

Опубликовано: 09 Июнь 2026
на канале: SooNmus
16
2

Here's a quick script our AI created to easily watermark entire folders full of images, eliminating the need for manual work or paid applications!(And remember: some free ones make you pay with your data! 💵)So, this one is genuinely free. All you need is Python and Pillow.

Simply copy and paste the following into your preferred text editor, then adjust the paths according to your watermark, input, and output folder. Save the file as "whatever.py."

Run ➡️ done

Helpful?Please share, subscribe, and leave a like; it means a lot! 🤝

#### python:

https://www.python.org/

#### pillow use pip:

pip install Pillow
#### Script:

import os
from PIL import Image, ImageDraw, ImageEnhance

def watermark_folder(input_folder, output_folder, watermark_image_path, opacity=0.25):
os.makedirs(output_folder, exist_ok=True)

for filename in os.listdir(input_folder):
if filename.endswith((".jpg", ".jpeg", ".png")):
input_image_path = os.path.join(input_folder, filename)
output_image_path = os.path.join(output_folder, filename)
watermark(input_image_path, output_image_path, watermark_image_path, opacity)

def watermark(input_image_path, output_image_path, watermark_image_path, opacity=0.25):
original_image = Image.open(input_image_path)

watermark = Image.open(watermark_image_path)

watermark = watermark.resize((original_image.width // 4, original_image.height // 4))

overlay = Image.new("RGBA", original_image.size, (0, 0, 0, 0))

overlay.paste(watermark, (original_image.width - watermark.width, original_image.height - watermark.height), watermark)

watermarked = Image.alpha_composite(original_image.convert("RGBA"), overlay)

watermarked.save(output_image_path, format="PNG")

input_folder = r"C:\path\to\your\input"
output_folder = r"C:\path\to\your\output"
watermark_image_path = r"path\to\your\watermark.png"

watermark_folder(input_folder, output_folder, watermark_image_path)