AA-lib tuning


     dT8  8Tb     
    dT 8  8 Tb    
   dT  8  8  Tb   
<PROJECT><PROJECT>
 dT    8  8    Tb 
dT     8  8     Tb

If you start aview (and AA-lib based image browser) on random image in random configuration, it is well possible to get result like this one:
josef holecek josef holecek in ASCII art version 1
No wonder that you won't get impressed. So I've put together following page to guide you trough few steps how to improve the quality.

Proper AA-lib based programs should accept the standard set of command line options. They also should print summary when -help is passed.

Some programs, however, may not give aa-lib chance to read their command line options. Then the environment variable AAOPTS may be used instead. You may also want to set that variable to customize default values.

The otpions may be used to tune various aspects of AA-lib.
Josef Holecek in ascii art version 1

Choosing output driver

Josef Holecek in ascii art version 2
Perhaps the most important is choosing of output driver. On many systems, AA-lib may output text in multiple different ways. By default it uses the driver it believes is most advanced.

These default settings are usually OK for DOS and OS/2 based systems.

On UNIX based systems, the most commonly used drivers are slang and curses. These do have numerous disadvantages, such as:

So it is recommended to use, whenever possible the alternate drivers. First one is an X11 driver, that will be enabled any time you set meaningful DISPLAY environment variable.

On Linux console you may want to use the Linux drivers. There is an output driver that use /dev/vcsa files and is very fast, able to fetch the font and does contain multihead support. To enable it you need write access to the /dev/vcsa file, that is sadly not available by default on most Linux distributions. You have options to eighter run the program as root, give it sticky bit (both are security holes of course), or hack the login program to modify the owner in similar way as it does for /dev/tty.

There is also corresponding keyboard driver, that is able to use raw keyboard support and thus detect releases of keys and mouse driver that support interface of gpm mouse server.

If there is need to stay with curses or slang driver, you may consider specifying -font or -inverse attributes to make output more match your setting. Refer to AA-lib manual for details. Also -nodim and -nobold can be used if your terminal renders these in weird way or to speed up the output.

On Windowed systems you also may want to specify the -width and -height parameters to specify default window size.
Josef Holecek in ascii art version 2

Choose details.

Josef Holecek in ascii art version 3
Especially for photos, it is good idea to choose an detail. Overall photos with lots of small details won't get out very well.
Josef Holecek in ascii art version 3

Specify proper bright/contrast/gamma etc.

Josef Holecek in ascii art version 4
Since ascii output lack number of details, it is usually needed to tweak the bright/contrast/gamma correction values individually for each usage. This can be done by specifying the -bright/-contrast/-gamma values or in the aview image browser by keys mentioned in help.

On some setup it may be needed to change value of dimmul/boldmul. These specify the difference in brightness between dim, normal and bold characters.

The default parameters are set to fit my monitor (15" goldstar) With contrast set to maximum and bright set to make black black This values depends at quality of your monitor (and setting of controls Default settings should be OK for most PC monitors. But ideal monitor Needs dimmul=1.71 boldmul=1.43. For example monitor used by SGI is very close to this values. Also old 14" vga monitors needs higher values. After setting all these values, image looks like:

josef holecek in ascii art version 4
HTML version | Text version
The HTML and text versions of image can be created using AA-lib's save driver via aview image browser (using 's' key).
Josef Holecek in ascii art version 4

Attributes and futher improvements

Josef Holecek in ascii art version 5
By default AA-lib uses dimm and bold characters where available. It also may use reverse attribute as well as extended character set. If you want to enable some of these features, just appropriate command line option. Here is example after enabling all of these:
josef holecek in ascii art version 5
It does change the font used by X11 driver using AAFont environment variable and uses "-*-fixed-bold-*-*-*-*-70-*-*-*-*-*-*".
Copyright (C) 2001 by Jan Hubicka