Skip to content

Instantly share code, notes, and snippets.

@ZhongxuanWang
Created September 19, 2022 23:38
Show Gist options
  • Save ZhongxuanWang/a1c7ff43b09affc0fa3489532abff307 to your computer and use it in GitHub Desktop.
Save ZhongxuanWang/a1c7ff43b09affc0fa3489532abff307 to your computer and use it in GitHub Desktop.
Word Art part 1
# Put your text here
words = 'word-art'
n_special_characters = 0
for w in words:
n_special_characters += w.isalpha()
n_special_characters = len(words) - n_special_characters
words = words.upper()
img = np.zeros(shape=(100,90 * len(words) + n_special_characters * 45), dtype=np.int16)
cv2.putText(img=img, text=words, org=(0, 100), fontFace=cv2.FONT_HERSHEY_PLAIN, fontScale=9, color=(255, 255, 255),thickness=5)
plt.imshow(img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment