Skip to content

Instantly share code, notes, and snippets.

View sonpython's full-sized avatar
🎯
Focusing

Michael Phan sonpython

🎯
Focusing
View GitHub Profile
__author__ = "Mark Allan B. Meriales"
# based from http://www.pythoncentral.io/watermark-images-python-2x/
# mine uses a picture as a watermark
# michaelphan add base_ratio for logo and better logo scale
from PIL import Image, ImageEnhance
def add_watermark(image_file, logo_file, opacity=1):
img = Image.open(image_file).convert('RGB')