Created
September 19, 2022 23:38
-
-
Save ZhongxuanWang/a1c7ff43b09affc0fa3489532abff307 to your computer and use it in GitHub Desktop.
Word Art part 1
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
# 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