Skip to main content

a python tool to convert the text into a image.

Project description

txt2img is a python tool to convert the text into a image.

1. Introduction

Normally people read the text in the .txt file. Sometimes there are needs for people to render the text into an image, for example you don’t want the text being copied, or you’d like to render the ascii art with colors, etc.

2. how to use it

After install, you can convert a text to a picture easily:

txt2img input.txt output.png

After install, you can also embed the asciiart directly into a html or pdf document with my developed script: sphinxcontrib-cmd2img, for examples:

.. cmd2img:: txt2img
    :caption: a flower

    .· .·.   /╲     /|
            ·│  \  ╱ |
       \-.___ / \  \/ / /
        \ __ ╲  .,.| ╱__
        ╱  乁  '\|)╱ ̄  ╲
    -<`︶╲__╱ ︶╲    ╲ \
         ̄ ̄ /   /  ╱﹀乀 \│
             ╲  ' /╲  ·╲/
               \| /   \  ; `
                \/     \  ·,
    .----/      ′      ︳  ·__,

More and more features are in develop.

5. CHANGLOG

1.0.0 Initial upload;
1.0.1 Given a prompt for user to input the font path.
1.0.2 Add a new option fontsize to set the font size.
1.0.3 Add a new option “spacing” to adjust the line space.

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

txt2img-1.0.3.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file txt2img-1.0.3.tar.gz.

File metadata

  • Download URL: txt2img-1.0.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

File hashes

Hashes for txt2img-1.0.3.tar.gz
Algorithm Hash digest
SHA256 553cdb0bef7daf80172570238c33382997f6adcc6901f20263ca8cc9929daa37
MD5 098c9297a4c744fa4da6c286d0172bb3
BLAKE2b-256 053b4dfa5c1e2035292437b6dbf22d41ff3b2dcd28402b3101ea77d727fff656

See more details on using hashes here.

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