Painting with cadubi

It seems the longer I write in this darned blog, the harder it gets to remember things I have talked about before … and things I haven’t.

That appears to have been the case this time, because I intended to but — if is to be believed — didn’t properly explain cadubi, which I happen to like as a vaguely artistic and somewhat amusing way of “painting” text for the console.

Now like everything else I mention, you shouldn’t get your hopes up. Console is console, and there’s almost nothing to be done to convert chunky block text into something resembling an actual picture. Almost.

Here’s how it works. Cadubi is basically a stamp-painting program, with a few simple hot-wirings that make it more usable. You set a pen shape, a foreground color and background color. Navigate with the arrow keys or with i-j-k-l, and when you smack the spacebar, the pen drops and stamps that location with the shape and colors you picked.

Nothing could be simpler. I could’ve sworn I wrote a program not too different from this in my junior high school programming class. Hello, Atari 800.

It’s fairly basic, but for what you can probably imagine, it’s also slightly inconvenient if you want to add a word or a sentence to an image. cadubi is one step ahead of you on that front, allowing you to switch to a typewriter-esque mode, and type normally on the image, a la a text tool box.

All very nice, but where’s the quan, you ask? Well, like a lot of cool things for the console, when they stand alone, they don’t impress much. But when combined with other console gizmos, they suddenly offer new potential.

cadubi can also read in files, edit them, and output to disk again. Enter figlet, setting the width of the output and the font from the command line …

figlet -w 132 -f big Motho ke motho ka botho

And then reading it into cadubi.

Experiment with things like …

figlet -f big `echo $HOSTNAME`

or even

figlet -w 132 -f big `echo $HOSTNAME` \/\/ Crux Linux `uname -r` > login.txt

Set the pen colors before reading in the file, and cadubi will paint the entire image in that scheme. And once that’s written back out again, you can tack it on to your /etc/issue file, in a manner somewhat similar to this, and make your logins quite entertaining.

The fun doesn’t stop there. Remember caca? The colorized console text that can take input from mplayer and pipe it to the framebuffer? Well with it you usually get img2txt, which does much the same thing for a static image, of almost any type. Ergo. …

img2txt -W 102 -f utf8 wp-cccp-1280x1024.jpg > cccp.utf8.txt

And before you know it …

Touch that up, tie it to your login prompt and every geek within a kilometer radius will be sick to their stomachs with envy.

There’s lots of fun to be had here, provided you’re patient, artistic, open-minded and willing to learn. cadubi isn’t anything new, and I’m sure there are better ways to put it to use, but that should give you some ideas to start. 🙂


4 thoughts on “Painting with cadubi

  1. Onyros

    K., this is a little OT, but as I was looking at that last screenie, I kept wondering… Where did you find that 12pt terminus font? I’ve been using different fonts, but I really like terminus, just not @ 14pt.

    Is there an Arch package? I’ve looked around and didn’t find anything.

  2. Pingback: Destillat KW47-2009 | - GNU/Linux, Open Source, Softwareentwicklung, Selbstmanagement, Vim ...

  3. kgas

    There is no PKGBUILD in arch, you can make one. A deb file is there in Ubuntu and you can convert it ot tar.gz file using deb2targz for Arch.

  4. Pingback: figlet and asciimo and a little irony « Motho ke motho ka botho

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s