Skip to main content

Easiest way to create text thumbnail.

Project description

Text to Image (Text to PNG)

version license pyversions
donate powered made

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, pixel
        padding=15,
        # file name
        filename="hello.png"
    )
)
# C:\\Temp\\hello.png

Project details


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.0.3.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

text2png-0.0.3-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page