img2txt(1)
img2txt π the glow-up your pixels deserve
okay bestie, so this is the manual page for img2txt β it lives in section 1 of the General Commands Manual, which is the section for user commands, iykyk. it's a little tool from the libcaca crew and it's literally here to turn your pics into text art. obsessed.
β¨ NAME β¨
img2txt β convert images to various text-based coloured files π
β¨ SYNOPSIS β¨
img2txt [ -W width ] [ -H height ] [ -x font-width ] [ -y font-height ]
[ -b brightness ] [ -c contrast ] [ -g gamma ]
[ -d dither ] [ -f format ] FILE
β¨ DESCRIPTION β¨
so img2txt converts images into colour ASCII characters and outputs them into text-based coloured files. that's the whole vibe. π
it can load basically the most widespread image formats ever: PNG, JPEG, GIF, PNG, BMP etc β and yes bestie, PNG is in that list twice, that's just how the manpage said it, no cap, we're keeping it. (peep the NOTES section for the details π)
by default the output text is 60 columns wide, and the line count gets computed accordingly so the aspect ratio of the original file is respected. and the default output format? standard ANSI coloured text. periodt.
β¨ OPTIONS β¨
-W,--width=<width>β changes the output column count. if you don't give it one, the default is 60.-H,--height=<height>β changes the output line count. if you don't give it one, the height gets computed to match the correct aspect ratio. π¦-x,--font-width=<width>β changes the output font width. if you don't give it one, the default is 6. this value is what gets used for computing the aspect ratio.-y,--font-height=<height>β changes the output font height. if you don't give it one, the default is 10. this value is what gets used for computing the aspect ratio.-b,--brightness=<brightness>β changes the image brightness. defaults to 1.0.-c,--contrast=<contrast>β changes the image contrast. defaults to 1.0.-g,--gamma=<gamma>β changes the image gamma. defaults to 1.0.-d,--dither=<dither>β changes the dithering algorithm. it can be one of these (defaults to fstein):noneβ nearest colorordered2β ordered 2x2ordered4β ordered 4x4ordered8β ordered 8x8randomβ randomfsteinβ Floyd Steinberg
-f,--format=<format>β changes the output format. it can be one of these (defaults to ansi):ansiβ coloured ANSIcacaβ internal libcaca formatutf8β UTF8 with CRutf8crβ UTF8 with CRLF (MS Windows)htmlβ HTML with CSS and DIV supporthtml3β Pure HTML3 with tablesircβ IRC with ctrl-k codesbbfrβ BBCode (French)psβ Postscriptsvgβ Scalable Vector Graphicstgaβ Targa Image
-h,--helpβ displays the help message and exits. π«Ά-v,--versionβ displays the version of the program and exits. π
β¨ EXAMPLES β¨
the classics, bestie, run these and watch the magic happen:
img2txt hello.jpg > hello.ans
img2txt --width=40 --format=svg hello.jpg > tinyhello.svg
like?? tinyhello.svg?? iconic. π
β¨ NOTES β¨
setting both the column count and the line count (with --width and --height) lets you pick the exact output size without taking the aspect ratio into account. so you're the main character now, you decide. π
important!! you must compile the libcaca package with support of Imlib2 if you want to be able to load a wide variety of image formats. otherwise you'll only be able to load regular BMP files. so like... go get that Imlib2 support, bestie, don't settle for BMP-only energy. π
β¨ SEE ALSO β¨
β¨ AUTHOR β¨
this manual page was written by Sam Hocevar <sam@hocevar.net> and Jean-Yves Lamoureux <jylam@lnxscene.org>. legends, honestly. π
and that's a wrap on the libcaca manual page, dated 2007-11-07, written by those two absolute icons β go forth and turn your JPEGs into text, bestie, you got this πβ¨π
π¦ where this page comes from
- alpine 3.24: libcaca-doc 0.99_beta20-r5 Β· WTFPL
- arch rolling: libcaca 0.99.beta20-7 Β· WTFPL
- debian bookworm: caca-utils 0.99.beta20-3+deb12u1 Β· WTFPL-2
- debian trixie: caca-utils 0.99.beta20-5+deb13u1 Β· WTFPL-2
- epel 10: caca-utils 0.99-0.75.beta20.el10_0 Β· WTFPL
- epel 9: caca-utils 0.99-0.69.beta20.el9 Β· WTFPL
- fedora 43: caca-utils 0.99-0.80.beta20.fc43 Β· WTFPL
- fedora 44: caca-utils 0.99-0.82.beta20.fc44 Β· WTFPL
- nixpkgs unstable: libcaca 0.99.beta20
- opensuse-leap 16.0: caca-utils 0.99.beta20-160000.3.1 Β· WTFPL
- opensuse-leap 16.0: caca-utils 0.99.beta20-160000.3.1 Β· WTFPL
- opensuse-leap 16.0: caca-utils 0.99.beta20-160000.3.1 Β· WTFPL
- opensuse-leap 16.0: caca-utils 0.99.beta20-160000.3.1 Β· WTFPL
- ubuntu jammy: caca-utils 0.99.beta19-2.2ubuntu4
- ubuntu jammy: caca-utils 0.99.beta19-2.2ubuntu4.2
- ubuntu noble: caca-utils 0.99.beta20-4build2 Β· WTFPL-2
- ubuntu noble: caca-utils 0.99.beta20-4ubuntu0.2 Β· WTFPL-2
- ubuntu questing: caca-utils 0.99.beta20-5
- ubuntu questing: caca-utils 0.99.beta20-5ubuntu0.25.10.2
- ubuntu resolute: caca-utils 0.99.beta20-6ubuntu2 Β· WTFPL-2
- ubuntu resolute: caca-utils 0.99.beta20-6ubuntu2.1 Β· WTFPL-2
- ubuntu stonking: caca-utils 0.99.beta20-8 Β· WTFPL-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms