fire-eggs / fire-eggs/pyTagger
Thumbnail watermark
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Add a watermark to thumbnails as per these states:
1. Image has tags
2. Image doesn't support tags (e.g. GIF)
3. Image in error state, preventing tags from working
```python
# embed image watermark
with Image.open("arya.jpg") as img:
# Get the width and height of the image
width, height = img.size
# Get the image watermark that already prepared
logo = Image.open("thumb.jpg")
# Resizing the watermark into desired size
size = (100, 100)
logo.thumbnail(size)
# Set the watermark position, if 0, it will set into top left of image
x = 0
y = 0
# Set the watermark position, if written as below, it will set into bottom right of image
x = width - 100
y = height - 100
# Integrate the image watermark into the watermark position
img.paste(logo, (x, y))
# Show the image
img.show()
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.