Jitac 0.3.0 - Image To ASCII Converter

Copyright © 2001, 2002 by Konrad Rieck



Jitac is an image to ASCII converter written in Java. Yes, you guessed right, this is a cute console application that converts high-quality images into oldschool ASCII art. If you find this idea ridiculous, well, better don't read on.


Version Date Changes
0.3.0 2012-12-27 Re-packaged source and binary release
0.2.0 2002-02-01 Support for HTML generation
0.1.2 2001-11-26 Jitac has been integrated into the roqe.org package hierarchy.
0.1.1 2001-09-03 Fixed a bug in the font path handling under Windows.
0.1 2001-09-01 Initial release.


Source packages
Release Source Package Size
Jitac 0.3.0 jitac-0.3.0.src.jar 142kb
Jitac 0.2.0 jitac-0.2.0.src.jar 189kb
Jitac 0.1.2 jitac-0.1.2.src.jar 186kb
Jitac 0.1.1 jitac-0.1.1.src.jar 151kb
Jitac 0.1 jitac-0.1.src.jar 151kb
Binary packages
Release Binary Package Size
Jitac 0.3.0 jitac-0.3.0.jar 64kb (w/o JIMI)
Jitac 0.2.0 jitac-0.2.0.jar 556kb
Jitac 0.1.2 jitac-0.1.2.jar 553kb
Jitac 0.1.1 jitac-0.1.1.jar 553kb


Jitac reads a source image that can have one of the following formats: GIF, JPEG, TIFF, PNG, PICT, Photoshop, BMP, Targa, ICO, CUR, Sunraster, XBM, XPM and PCX. Jitac also reads in a font which can be chosen from a list of integrated fonts or loaded from a BDF font file. The result of the image to ASCII conversion strongly depends on the chosen font. Images rendered with a font and displayed with another font may look really weird.

Before the conversion some filters and optional features can be applied to the source image, e.g. inversion, re-sizing/scaling, gamma correction. The conversion is done by dividing the image into blocks that have equal size and whose dimensions match the character dimensions. For each block the character is chosen that best matches the pixels inside the block. Features such as noise or rounding (often used in neural networks) can be used to improve conversion quality.

By default Jitac uses all visible ASCII characters in the range 32-126, but Jitac also allows using different ranges or even a specified set of characters for converting an image, e.g. the set " .o0O".

Jitac has been written by Konrad Rieck. Jitac requires an installation of JIMI, the Java Image Manipulation Interface. Jitac is licensed under the GNU General Public License Version 3 (GNU GPLv3).


Actually there is no big kind of installation, just copy the Jitac Jar to a directory. Additionally, you may need to adapt your classpath to point to the installation of JIMI. You can then execute Jitac by running the following command in this directory:

   $ java -jar jitac-VERSION.jar
where VERSION is the version of Jitac you downloaded.


Jitac comes with a README file inside the Jar Archive, you can display the file by running the following command

   $ java -jar jitac-0.1.1.jar -R
You can also read the README file here. A short description of all command line options can be displayed by running:
   $ java -jar jitac-0.1.1.jar -h
For more details refer to the README and see the following examples.


A simple example

   $ java -jar jitac-0.2.0.jar -w 60 -o slumb.asc slumb.gif

Original Mixed ASCII
Let's start with a simple example. The image below is a cartoon character, the images has a high contrast and fine contours. Those images are ideal for ASCII conversion. The characters can follow the fine contours and the result is quite good, even if displayed with a medium sized font.

The image was converted using Jitac "out-of-the-box", no special options were needed.


No noise
   $ java -jar jitac-0.2.0.jar -o gradients.asc gradients.gif
Noise 0.37
   $ java -jar jitac-0.2.0.jar -n 0.37 -o gradients.asc gradients.gif
Working with photos or images that have fine granulated gradients is more difficult. In normal mode Jitac finds the character that best matches a given block of the image. This is done by interpreting the block and all characters as vectors and computing the Euclidean distance between the block and all characters. The character with the smallest distance is chosen as a representative of the block.
Gradient conversion

Due to the fact that characters are black and white images, gradients are badly converted because the white space character often has the smallest distance to the blocks. In order to avoid this behaviour, Jitac uses a trick, that is used in most neural network algorithms. It can add a specified noise to the characters. Calculating the distance now gives better results.
The first image shows the source, the second a conversion with no noise, and the third a conversion with noise 0.37 (37% noise in characters).

HTML and color conversion

HTML conversion
   $ java -jar jitac-0.2.0.jar -H -o izab.html izab.jpg
HTML conversion with color
   $ java -jar jitac-0.2.0.jar -C -o izab.html izab.jpg
HTML conversion with color, only blue and green channel
   $ java -jar jitac-0.2.0.jar -c 6 -C -o izab.html izab.jpg

Since version 0.2 Jitac is able to convert images into HTML pages by adjusting the characters, e.g. escaping > and < and by adding a simple header and footer to the output.

All channels
Blue channel
The possibilities of HTML files allow the usage of colors and some color specific modifications. By using color masks you are able to filter colors at the input and at the output. Jitac has three color flags: red=1, green=2 and blue=4. The colors can be combined, e.g. 5 represents red and blue.

The images to the right show how color mask filtering improves the output result. The image at the right most has been converted using a blue input color channel mask.

It's quality is even better than the image converted with all input color channels due to the fact that a blue channel mask improves red and green colors in the result if no output color channel mask is used.

Photo conversion

   $ java -jar jitac-0.2.0.jar -w 70 -f fixed05x07 -n 0.25 -o gumbrecht.asc gumbrecht.jpg
Original Mixed ASCII
This nice photo of Gumbrecht was converted using a noise of 0.25. Converting photos is even harder than just simple gradients as above. For good results, you need to use a rather small font.