Easiest way to create text thumbnail.
Project description
Text to Image (Text to PNG)
Easiest way to create text thumbnail.
Hierarchy
text2png
'---- TextToPng()
'---- create()
Example
python
from text2png import *
t2p = TextToPng(
# absolute path to font file
font_file="C:\\Windows\\Fonts\\msgothic.ttc",
# font size, integer
font_size=64,
# background color, RGB value
background_color=(0, 0, 0),
# text color, RGB value
text_color=(255, 255, 255),
# png file save directory
save_dir="C:\\Temp"
)
print(
t2p.create(
# what text
text="HELLO",
# text padding, in pixels
padding=15,
# file name
filename="hello.png"
)
)
# C:\\Temp\\hello.png
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
text2png-0.1.0.tar.gz
(2.8 kB
view hashes)
Built Distribution
text2png-0.1.0-py3-none-any.whl
(15.0 kB
view hashes)