Skip to content

Instantly share code, notes, and snippets.

@symisc
Last active April 14, 2022 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save symisc/94109c10ab319abfff3c5010224ac60e to your computer and use it in GitHub Desktop.
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
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