./configure make make test # optional make installIf you have jpeglib installed in non-standard directory, say in /opt/local/include/jpeglib.h and /opt/local/lib/libjpeg.a then you can do
./configure --with-jpeg-prefix=/opt/local
./configure --prefix=/usr make make install-lib # simply make install is not good enough for jp2a
sudo port install jp2athen everything should be installed.
pkg_add -r jp2a
apt-get install jp2a
emerge jp2a
jp2a --width=76 file.jpgHowever, if you want to be able to read other graphics-formats, you can use ImageMagick's convert program with pipes, like
convert somefile.png jpg:- | jp2a --width=76 -Convert is a very nice utility, letting you set a lot of options that might enhance the ASCII output (e.g. by setting contrast and brightness). Another example, increase brightness by 170% and then rotate 45 degress clockwise:
convert bender.bmp -modulate 170 -rotate 45 jpg:- | jp2a -Convert handles just about any graphics-format you can think of, including video formats and vector formats like PDF and Postscript (handled by convert using Ghostscript).
jp2a http://foo.bar/image.jpgIf you didn't compile jp2a with curl, you can use another HTTP reader and pipe the result to jp2a: For instance, to download and convert the Google logo all on the fly, you can do this:
convert http://www.google.com/intl/en/images/logo.gif jpg:- | jp2a - ....... .':. .::'....':xd. dX' .ld. .. . oX. ... ;O' .c;..'cxc ;,...,c;. .:'.,lxc. dX. ,:'.,dx.. . oO. .ox. ,x0 .cd. .cd..ll l0. xX. :K,..,::. cxx. .',cl 'x0 lK'.cx ;k, lO; .ll. dX. o0: ,dkc. :kd :kx. :d; ,ol. .lc. .''lk' kX' oOo'... .;:cc;,,',,. .;;,'.. .,,'... ''',:lxo. .','. .,::;. .oc. dO lk;....'c' .'....
I was asked if there are any bindings for Python. Unfortunately, no, but if anyone wants to make that, let me know.