Effortlessly transform any text into high-quality PNG images.

Perfect for displaying code, terminal outputs, or command results in presentations and articles.

Preserve text styles, colors with ANSI sequence compatibility.

🚀 Key Features

  • Social Media Sharing

    Create shareable snippets of code, logs, or formatted text for platforms like Twitter and LinkedIn.

  • Ideal for Self-Publishing

    Embed beautifully rendered text snippets in eBooks, blogs, and technical manuals.

  • Seamless Integration

    Use the tool to convert outputs from kubectl , curl , jq , bat and other CLI tools into polished visuals.

  • Multi-Language and Unicode Support

    Render text in any language, including special characters and emoji.

  • Cross-Platform Compatibility

    Available for Linux, macOS, and Windows.

  • Output Customization

    Adjust margins, line spacing, and background transparency for precise layouts.

  • Portable and Lightweight

    Small footprint for fast installations and minimal system resource usage.

📥 Download and Install

You can install the tool in one of the following ways:

Manual Installation

  • Download the zip file, extract it to a folder of your choice, and start using the tool.
  • For convenience, you can add its path to the PATH environment variable.

Choose your platform to start using txtimg:

Using a Package Manager

» macOS, linux » Homebrew

brew tap lucasepe/cli-tools
brew install txtimg

⚙️ USAGE

txtimg <ACTION> [FLAGS]

ACTIONS

Action Description
-R Render text as image
-L List of all available themes
-h,–help Display this help and exit
-v,–version Output version information and exit

FLAGS

Flag Description Default
-i <file> input file with the text to render stdin
-o <file> output file for the rendered PNG output.png
-b <hex color> background color #fafafa00
-c <hex color> text color #023020ff
-t <string> preset colors theme bold
-m <integer> outer space surrounding text 8
-s <integer> font height in pixels 14
-l <float> vertical space between text lines 1

📚 EXAMPLES

» Render a text file as PNG (use default options):

txtimg -R -i document.txt 

» Render a text file as PNG (use a theme):

txtimg -R -i document.txt -t majestic

» Render piped text content as PNG:

tree | txtimg -R -s 30 -o tree.png
bat main.py --color=always --plain --wrap=never | txtimg -R

👍 SUPPORT

All tools are completely free to use, with every feature fully unlocked and accessible.

If you find one or more of these tool helpful, please consider supporting its development with a donation.

Your contribution, no matter the amount, helps cover the time and effort dedicated to creating and maintaining these tools, ensuring they remain free and receive continuous improvements.

Every bit of support makes a meaningful difference and allows me to focus on building more tools that solve real-world challenges.

Thank you for your generosity and for being part of this journey!