<?php header("Content-Type: text/html; charset=utf-8"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="GENERATOR" content="vim" /> <meta name="Author" content="sam@zoy.org (Sam Hocevar)" /> <meta name="Description" content="libcaca - Colour AsCii Art library" /> <meta name="Keywords" content="libcaca, ASCII, ASCII ART, console, text mode, ncurses, slang, AAlib" /> <title>libcaca - Colour AsCii Art library</title> <link rel="icon" type="image/x-icon" href="/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> <link rel="stylesheet" type="text/css" href="/main.css" /> </head> <body> <?php include($_SERVER["DOCUMENT_ROOT"]."/header.inc"); ?> <img src="logo-caca.png" width="128" height="128" alt="libcaca logo" class="caca" /> <h2> Introduction </h2> <p> <i>libcaca</i> is a graphics library that outputs text instead of pixels, so that it can work on older video cards or text terminals. It is not unlike the famous <a href="http://aa-project.sourceforge.net/aalib/">AAlib</a> library, with the following improvements: </p> <ul> <li> Unicode support </li> <li> 2048 available colours (some devices can only handle 16) </li> <li> dithering of colour images </li> <li> advanced text canvas operations (blitting, rotations) </li> </ul> <p> Libcaca works in a text terminal (and should thus work on all Unix systems including Mac OS X) using the S-Lang or ncurses libraries. It also works natively on DOS and Windows. </p> <p> Libcaca was written by Sam Hocevar <<a href="mailto:sam@zoy.org">sam@zoy.org</a>> and Jean-Yves Lamoureux <<a href="mailto:jylam@lnxscene.org">jylam@lnxscene.org</a>>. It is <a href="http://www.gnu.org/philosophy/free-sw.html">free software</a>, and can be used, modified and distributed under the terms of the <a href="http://sam.zoy.org/wtfpl/">Do What The Fuck You Want To Public License</a>. </p> <p style="text-align: center;"> <a href="http://www.ohloh.net/projects/9011?ref=WidgetProjectThinBadge"><img src="http://www.ohloh.net/projects/9011/widgets/project_thin_badge.gif" width="100" height="16" alt="libcaca Ohloh metrics" /></a> <a href="http://www.ohloh.net/projects/9018?ref=WidgetProjectThinBadge"><img src="http://www.ohloh.net/projects/9018/widgets/project_thin_badge.gif" width="100" height="16" alt="toilet Ohloh metrics" /></a> </p> <h2> News </h2> <ul> <li> <b>18 May 2008</b>: <a href="/wiki/zzuf">zzuf</a> 0.11 </li> <li> <b>1 Apr 2008</b>: libcaca to be <a href="http://blog.thebehrens.net/2008/04/01/new-highly-portable-canvas-backend/">OpenOffice.org’s official multiplatform rendering backend</a> </li> <li> <b>24 Feb 2008</b>: we are now using <a href="/wiki">Trac</a>! </li> <li> <b>24 Jan 2008</b>: <a href="/labs/img2oric.html">img2oric</a>, the first Caca Labs piece of research software </li> <li> <b>28 Nov 2007</b>: libcaca 0.99.beta13 </li> <li> <b>24 Oct 2007</b>: Report on <a href="/cacacon07/">CacaCon’07</a>, the first international libcaca conference. </li> <!-- old news <li> <b>30 Sep 2007</b>: libcaca 0.99.beta12 </li> <li> <b>16 Nov 2006</b>: libcaca 0.99.beta11 </li> <li> <b>16 Nov 2006</b>: <a href="/toilet.html">TOIlet</a> 0.1 </li> <li> <b>12 Nov 2006</b>: libcaca 0.99.beta10 </p> <li> <b>6 Nov 2006</b>: libcaca 0.99.beta9 </p> <li> <b>22 Oct 2006</b>: libcaca 0.99.beta8 </p> <li> <b>4 Oct 2006</b>: libcaca 0.99.beta7 </p> --> </ul> <img src="img/sample.png" width="128" height="128" alt="libcaca rendering sample" class="caca" /> <h2> Screenshots </h2> <p> Here are a few <i>libcaca</i> screenshots. </p> <table cellspacing="5" border="0"> <tr> <td align="center"> <a href="img/stitch-80x45.png"><img alt="cacaview" width="73" height="90" src="img/tn-stitch-80x45.jpeg" /></a> <br /><small><code>cacaview</code></small> </td> <td align="center"> <a href="img/cacaball-80x50.png"><img alt="cacaball" width="101" height="90" src="img/tn-cacaball-80x50.jpeg" /></a> <br /><small><code>cacaball</code></small> </td> <td align="center"> <a href="img/cacaplas-80x50.png"><img alt="cacaplas" width="101" height="90" src="img/tn-cacaplas-80x50.jpeg" /></a> <br /><small><code>cacaplas</code></small> </td> <td align="center"> <a href="img/truecolor-32x16.png"><img alt="truecolor" width="87" height="90" src="img/tn-truecolor-32x16.jpeg" /></a> <br /><small>TrueColor</small> </td> <td align="center"> </td> </tr> <tr> <td align="center"> <a href="img/unicode-80x24.png"><img alt="unicode" width="120" height="75" src="img/tn-unicode-80x24.jpeg" /></a> <br /><small>Unicode</small> </td> <td align="center"> <a href="img/swallow-80x32.png"><img alt="swallow" width="120" height="81" src="img/tn-swallow-80x32.jpeg" /></a> <br /><small>swallowing applications</small> </td> <td align="center"> <a href="img/rotate.png"><img alt="rotation" width="75" height="90" src="img/tn-rotate.jpeg" /></a> <br /><small>canvas rotation</small> </td> <td align="center"> </td> <td align="center"> </td> </tr> </table> <p> See also the various export formats, generated from an old <a href="lc-mw1.ans">ANSI file</a>: <a href="export.png">PNG</a> (through TGA), <a href="export.html">HTML</a>, <a href="export.svg">SVG</a>, <a href="export.ps">PostScript</a>. </p> <!-- <p> Here are my first libcaca attempts. The first image is, <code>cacaview</code>, the libcaca image viewer. Then, two screenshots of my first port of an application to libcaca: the <a href="http://www.videolan.org/vlc/">VLC</a> media player. The last screenshots are from <code>cacafire</code> (the libcaca port of aafire) and <code>cacaball</code> (a mini metaballs demo). </p> <table cellspacing="5" border="0"> <tr> <td align="center"> <a href="caca-stitch.png"><img alt="cacaview" width="78" height="90" src="tn-caca-stitch.jpeg" /><br /><code>cacaview</code></a> </td> <td align="center"> <a href="caca-vlc.png"><img alt="VLC playing the Matrix: Revolutions" width="120" height="74" src="tn-caca-vlc.jpeg" /><br />VLC media player</a> </td> <td align="center"> <a href="caca-vlc3.png"><img alt="VLC playing a Dolby trailer" width="120" height="74" src="tn-caca-vlc3.jpeg" /><br />VLC media player</a> </td> <td align="center"> <a href="caca-fire.png"><img alt="cacafire" width="120" height="87" src="tn-caca-fire.jpeg" /><br /><code>cacafire</code></a> </td> <td align="center"> <a href="caca-ball.png"><img alt="cacaball" width="104" height="90" src="tn-caca-ball.jpeg" /><br /><code>cacaball</code></a> </td> </tr> </table> <p> As with all image processing applications, I needed the obligatory <a href="http://www-2.cs.cmu.edu/~chuck/lennapg/">Lenna</a> samples. From left to right: the currently in development Floyd-Steinberg dithering, the antialiasing introduced in libcaca 0.5, the new renderer in libcaca 0.2, no dithering, ordered dithering, random dithering. </p> <table cellspacing="5" border="0"> <tr> <td align="center"> <a href="lenna-fs.png"><img alt="Lenna (Floyd-Steinberg)" width="87" height="90" src="tn-lenna-fs.jpeg" /><br />Floyd-Steinberg</a> </td> <td align="center"> <a href="lenna-antialias.png"><img alt="Lenna (antialiased)" width="97" height="90" src="tn-lenna-antialias.jpeg" /><br />antialiasing</a> </td> <td align="center"> <a href="lenna-new.png"><img alt="Lenna (new renderer)" width="99" height="90" src="tn-lenna-new.jpeg" /><br />new renderer</a> </td> <td align="center"> <a href="lenna-nodither.png"><img alt="Lenna (no dithering)" width="99" height="90" src="tn-lenna-nodither.jpeg" /><br />no dithering</a> </td> <td align="center"> <a href="lenna-ordered.png"><img alt="Lenna (ordered dithering)" width="99" height="90" src="tn-lenna-ordered.jpeg" /><br />ordered dithering</a> </td> <td align="center"> <a href="lenna-random.png"><img alt="Lenna (random dithering)" width="99" height="90" src="tn-lenna-random.jpeg" /><br />random dithering</a> </td> </tr> </table> <p> Here are a few examples of my libcaca patch for libSDL. Once there is a libcaca backend for <a href="http://www.libsdl.org">libSDL</a>, any program using SDL can automatically benefit from libcaca’s rendering routines. These examples show <a href="http://www.frozen-bubble.org/">Frozen Bubble</a>, the <a href="http://sabre.cobite.com/">SABRE</a> flight simulator, and the famous <a href="http://www.idsoftware.com/games/doom/">Doom</a>. Frozen Bubble is fully playable, but SABRE and Doom aren’t much due to the Ctrl and Shift keys not being recognized (see the TODO list about that). </p> <table cellspacing="5" border="0"> <tr> <td align="center"> <a href="caca-fb.png"><img alt="ASCII art Frozen Bubble" width="120" height="90" src="tn-caca-fb.jpeg" /><br />Frozen Bubble</a> </td> <td align="center"> <a href="caca-sabre.png"><img alt="the SABRE flight simulator" width="120" height="90" src="tn-caca-sabre.jpeg" /><br />SABRE</a> </td> <td align="center"> <a href="caca-doom.png"><img alt="the Doom splash screen in ASCII art" width="120" height="90" src="tn-caca-doom.jpeg" /><br />Doom splash screen</a> </td> <td align="center"> <a href="caca-doom2.png"><img alt="Doom in ASCII art" width="120" height="90" src="tn-caca-doom2.jpeg" /><br />first Doom level</a> </td> </tr> </table> <h2> Download libcaca </h2> <p> libcaca is already in the Debian sid distribution. Debian woody users or sid users in a hurry may use one of the following apt sources: (sorry, sarge is not supported yet) </p> <table class="leftmenu" cellspacing="5" cellpadding="0"> <tr> <td class="nowrap" valign="top"> <code> deb http://sam.zoy.org/projects/debian woody main<br /> deb-src http://sam.zoy.org/projects/debian woody main<br /> <br /> deb http://sam.zoy.org/projects/debian sid main<br /> deb-src http://sam.zoy.org/projects/debian sid main<br /> </code> </td> </tr> </table> <p> Users of RPM-based distributions (Red Hat, Fedora, Mandrake) may find RPM packages on the <a href="http://yarrow.freshrpms.net/rpm.html?id=552">Fresh RPMs</a> page. If no package is available, you are encouraged to build packages for your system using this SRPM (<a href="libcaca-0.9-1.src.rpm">libcaca-0.9-1.src.rpm</a>, 176KB) and this simple command line: </p> <table class="leftmenu" cellspacing="5" cellpadding="0"> <tr> <td class="nowrap" valign="top"> <code>rpm -<!>-rebuild libcaca-0.9-1.src.rpm</code> </td> </tr> </table> <p> BSD users should see the <a href="http://www.netbsd.org/packages/graphics/libcaca/README.html">NetBSD port page</a> and the <a href="http://www.freshports.org/graphics/libcaca/">FreeBSD port page</a> (I am not aware of an OpenBSD port yet, but <a href="http://news.gw.com/openbsd.ports/15502">this email</a> has information on it), Gentoo users may find information on the <a href="http://gentoo-portage.com/browse-program.php?program=6273">Gentoo portage</a> and Slackware users have a package on <a href="http://www.linuxpackages.net/pkg_details.php?id=2144">linuxpackages.net</a>. </p> <h2> Patch for libSDL </h2> <p> This simple patch was quickly hacked from the AAlib video driver. Apply it to the libSDL sources and configuree libSDL with <code>-<!>-enable-video-caca</code>. Then use the <code>SDL_VIDEODRIVER</code> environment variable to run your SDL programs with libcaca output, for instance Frozen Bubble: </p> <table class="leftmenu" cellspacing="5" cellpadding="0"> <tr> <td class="nowrap" valign="top"> <code>SDL_VIDEODRIVER=caca frozen-bubble</code> </td> </tr> </table> <p> Download <a href="patch-libsdl1.2-libcaca0.7.diff">patch-libsdl1.2-libcaca0.7.diff</a> (to be used with the Debian unstable SDL sources and libcaca 0.7. </p> <h2> Patches for VLC, xine, mplayer... </h2> <p> The libcaca patch for the <a href="http://www.videolan.org/vlc/">VLC</a> media player was already applied upstream. Check the CVS version. </p> <p> There is a work in progress for <a href="http://xine.sf.net/">xine</a> called cacaxine (see <a href="http://sourceforge.net/mailarchive/forum.php?thread_id=3605187&forum_id=7131">this email</a>). Zeeshan Ali wrote a <a href="http://gstreamer.sf.net/">GStreamer</a> plugin. I am not aware of an <a href="http://mplayerhq.hu/">MPlayer</a> patch yet (but you should not be using MPlayer anyway, because it sucks). </p> <h2> Development </h2> --> <h2> Why? </h2> <blockquote><p> Que dites-vous ?... C’est inutile ?... Je le sais ! <br />Mais on ne se bat pas dans l’espoir du succès ! <br />Non ! non, c’est bien plus beau lorsque c’est inutile ! <br /><small> -- Edmond Rostand, <i>Cyrano de Bergerac</i> </small> </p></blockquote> <p> I am perfectly aware that <i>libcaca</i> is the waste of time it looks to be. No need to tell me about that. I urge you to read Théophile Gautier’s preface to <i>Mademoiselle de Maupin</i>, which also gives an excellent explanation for the name “libcaca”: </p> <blockquote><p> Il n’y a rien de vraiment beau que ce qui ne peut servir à rien ; tout ce qui est utile est laid ; car c’est l’expression de quelque besoin ; et ceux de l’homme sont ignobles et dégoûtants, comme sa pauvre et infirme nature. - L’endroit le plus utile d’une maison, ce sont les latrines. </p></blockquote> <p> As for the name “libcucul”, please refer to the pioneer of modernist Polish fiction: </p> <blockquote><p> Mais contre le cucul, il n’y a pas de refuge. Courez après moi si vous voulez, je m’enfuis la gueule entre les mains. Et voilà, tralala, Zut à celui qui le lira ! <br /><small> -- Witold Gombrowicz, <i>Ferdydurke</i> </small> </p></blockquote> <?php $rev = '$Id$'; include($_SERVER['DOCUMENT_ROOT'].'/footer.inc'); ?> </body> </html>