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).
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
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:Default is
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
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):Default is
jave_algorithm
4_pixels_per_character
1_pixel_per_character
courier_new
, other examples arefixedsys
orlucida_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:(I had to put those in a file, for I don't know how to read space characters from a command line :-))
jave_algorithm
: The first line of the file contains the characters that shall not be used for conversion4_pixels_per_character
: dito1_pixel_per_character
: ditogradient
: The first line of the file contains the characters used for the gradient (example:.:coCO8@
).
java -jar jave4.jar image2ascii c:\images\jave_logo_big.gif algorithm=4_Pixels_per_Character width=50In 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.
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.
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.