Jitac 0.2.0 - Image To ASCII ConverterCopyright © 2001, 2002 by Konrad Rieck![]() IntroductionJitac 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 ridicilous, well, better don't read on. Changes
Downloads
DetailsJitac 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, resizing/scaling, gamma correction. The conversion is done by dividing the image into blocks that have equal size and whose dimensions match the charakter dimensions. For each block the charakter 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 charakters in the range 32-126, but Jitac also allows using different ranges or even a specified set of charakters for converting an image, e.g. the set " .o0O". Jitac has been written by Konrad Rieck. Jitac makes use of Jimi, the Java Image Manipulation Interface provided by Sun Microsystems. See the file Jimi-License for license information. GetOpt routines have been written by Aaron M. Renn. InstallationActually there is no big kind of installation, just copy the Jitac Jar Archive to a folder and you are ready. You can now execute Jitac by running the following command in this directory: $ java -jar jitac-VERSION.jarWhere VERSION is the version of Jitac you downloaded. UsageJitac 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 -RYou 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 -hFor more details refer to the README and see the following examples. Examples
A simple example$ java -jar jitac-0.2.0.jar -w 60 -o slumb.asc slumb.gif
The image was converted using Jitac "out-of-the-box", no special options were needed. GradientsNo noise$ java -jar jitac-0.2.0.jar -o gradients.asc gradients.gifNoise 0.37 $ java -jar jitac-0.2.0.jar -n 0.37 -o gradients.asc gradients.gifWorking with photos or images that have fine granulated gradients is more difficult. In normal mode Jitac finds the charakter that best matches a given block of the image. This is done by interpreting the block and all charakters as vectors and computing the euklidian distance between the block and all charakters. The charakter with the smallest distance is chosen as a representative of the block.
Due to the fact that charakters are black and white images, gradients are badly converted because the whitespace 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 charakters. 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 charakters). HTML and color conversionHTML conversion$ java -jar jitac-0.2.0.jar -H -o izab.html izab.jpgHTML conversion with color $ java -jar jitac-0.2.0.jar -C -o izab.html izab.jpgHTML conversion with color, only blue and green channel $ java -jar jitac-0.2.0.jar -c 6 -C -o izab.html izab.jpgSince 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.
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||