Author: Markus Gebhard

[docs]

# JavE image2ascii commandline utility

Since JavE4.0 the image2ascii converter can be accessed without using the graphical user interface by invoking JavE from the command line. JavE will convert the gif, bmp or jpg file and write the ascii result to the standard output (System.out).

## Usage

>     java -jar jave5.jar image2ascii imagefile {options}

> Note: You can write the output to a file on most systems by using the following syntax:

>     java -jar jave5.jar image2ascii imagefile {options} > outputfile

## Options

> `width=WIDTH` | `WIDTH` is the width of the result in characters. Default is 72.
> `shape=SHAPE` | `SHAPE` is the shape factor (for adjusting the height to width proportions) as double value. Default is 1.0.
> `algorithm=ALGORITHM` | `ALGORITHM` is the name of the conversion algorithm. Note that not all algorithms from the image2ascii converter are available at the command line yet. Supported algorithms are: `jave_algorithm` (new since JavE5.0) `4_pixels_per_character` `1_pixel_per_character` (new since JavE5.0, old one is renamed to 'Gradient') `gradient` `edge_detection` `edge_tracing` `felt_pen` Default is `jave_algorithm`.
> `table=TABLE` | `TABLE` is the name of the character greyscale table that shall be used for conversion. Choosing the table to fit the font used for displying the result will cause an optimum conversion result. This option can only be used for the following algorithms (others will ignore it): `jave_algorithm` `4_pixels_per_character` `1_pixel_per_character` Default is `courier_new`, other examples are `fixedsys` or `lucida_console`. For a complete list of font tables available onb your system have a look into the folder JAVE_MAIN_FOLDER/config/greyscaletables/
> `charfile=CHARFILE` | `CHARFILE` is the name of a text file containing special characters for the algorithm. The interpretation of this file depends on the algorithm being used. Here is a list of what it is used for at the moment: `jave_algorithm`: The first line of the file contains the characters that shall not be used for conversion `4_pixels_per_character`: dito `1_pixel_per_character`: dito `gradient`: The first line of the file contains the characters used for the gradient (example: `.:coCO8@`). (I had to put those in a file, for I don't know how to read space characters from a command line :-))

## Example

>     java -jar jave4.jar image2ascii c:\images\jave_logo_big.gif algorithm=4_Pixels_per_Character width=50

> In this example the file jave_logo_big.gif is converted to ascii using the 4-pixel per character algorithm and the result being 40 characters wide.

## Limitations

> The converter will not be suitable for real-time animations, as for every single image you have to start the Java Virtual Machine to launch JavE.

## Future Enhancements

> In case you have a question or need some options not yet provided by the command line interface - just let me know: markus@jave.de.