Last active
April 14, 2022 23:53
-
-
Save symisc/94109c10ab319abfff3c5010224ac60e to your computer and use it in GitHub Desktop.
Draw some funny text on top & button of the famous Michael Jordan crying face using the PixLab API - https://pixlab.io/cmd?id=drawtext
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
import requests | |
import json | |
# Draw some funny text on TOP & BOTTOM of the famous Cool Cat public domain image. | |
# https://pixlab.io/cmd?id=drawtext is the target endpoint for drawing text on images | |
req = requests.get('https://api.pixlab.io/drawtext',params={ | |
'img': 'https://pixlab.io/images/jdr.jpg', | |
'top': 'someone bumps the table', | |
'bottom':'right before you win', | |
'cap':True, # Capitalize text, | |
'strokecolor': 'black', | |
'key':'PIXLAB_API_KEY', # Get yours from https://pixlab.io/dashboard | |
}) | |
reply = req.json() | |
if reply['status'] != 200: | |
print (reply['error']) | |
else: | |
print ("Meme: "+ reply['ssl_link']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment