A simple and fast CLI tool that converts any text—ASCII or Unicode—into crisp PNG images.
- Convert text into a PNG image
- Read text from stdin, a file, or terminal input
- Automatic or manual image sizing
- Customizable text color, background color, and margins
- Optionally force square images
- Handles tabs with configurable tab width
txt2img [flags] [file]
- Pipe from stdin:
echo "Hello World" | txt2img -o out.png- Read from a file:
txt2img -o out.png myfile.txt- Manual input (if no file is provided and stdin is not piped):
txt2img -o out.png
Type your text and finish with CTRL+D
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!
Simply run the following command in your terminal:
curl -sL https://raw.githubusercontent.com/lucasepe/txt2img/main/install.sh | bashThis script will:
- Detect your operating system and architecture
- Download the latest release binary
- Install it into /usr/local/bin (requires sudo)
- otherwise fallback to $HOME/.local/bin
- Make sure the install directory is in your PATH environment variable
Manually download the latest binaries from the releases page:
Unpack the binary into any directory that is part of your PATH.
If you have Go installed
You can also install using:
go install github.com/lucasepe/txt2img@latestMake sure your $GOPATH/bin is in your PATH to run the tool from anywhere.