Created
July 22, 2014 16:56
-
-
Save cybertk/5bd1309b9b6da1213480 to your computer and use it in GitHub Desktop.
Add a text watermark to give image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
TEXT_ID = 'itunesartwork' | |
# Provided by sw-dev.herokuapp.com | |
os.environ.setdefault('CLOUDINARY_URL', | |
'cloudinary://api_key:secret') | |
from cloudinary.utils import cloudinary_url | |
from cloudinary.uploader import text, destroy | |
# Delete exist text | |
print destroy(TEXT_ID, invalidate=True) | |
# Create text | |
print text("Sample Name", public_id = TEXT_ID, | |
font_family = 'Helvetica', | |
font_size = 120, | |
font_weight = 'bold', | |
font_color = 'black', opacity = 80) | |
print cloudinary_url("sample.png", | |
overlay = "text:%s:1.12.4.1" % TEXT_ID, | |
gravity = "south_east", x = 2, y = 60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment