{banner} and {cb} March 16, 2003

About

The current image sequence on gemüsehaken.org is a series of images generated
by two programs, {banner} and {cb}. After many requests to explain the
workings of the duo, here’s a brief overview.

{banner} is the equivalent of Unix’s banner(1) program, for the Inferno platform.

Documents
If you’re in a hurry to score some {banner} and {cb} images, here’s a
document contaning a collection of various themes, all images created with the aforementioned
duo. I generally wrap the images in some HTML (usually with a background color of “#999999″),
then use Acrobat 5′s web capture feature to generate a PDF 1.4 document.

Nicht Ohne Meine {CB} This was presented at dorkbot-nyc,
Columbia University Computer Music School, March 5th 2003. I did indeed go through all 287 pages
in 20 minutes.

How it works : {banner}
{banner} is the equivalent of Unix’s banner(1) program, for the Inferno platform.
It produces a large text banner of the text strings supplied to it, for example:

; banner ACID

         #     #####    ###   ######  
        # #   #     #    #    #     # 
       #   #  #          #    #     # 
      #     # #          #    #     # 
      ####### #          #    #     # 
      #     # #     #    #    #     # 
      #     #  #####    ###   ######  

{banner} also takes a “-b” flag, with which it produces a bitmap banner, in which
whitespace are replaced with a ’0′ and the ‘#’ characters with a ’1′:

; banner -b ACID
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 
0 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 
0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 
1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 
1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 
1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 
1 0 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

{cb} takes as input lines of strings, delimited
by whitespace (space, tabs, newlines, carriage returns) and interprets
each string as the value to be used to color a rectangle in an image.

How it works: {cb}
{cb} takes as input lines of strings, delimited
by whitespace (space, tabs, newlines, carriage returns) and interprets
each string as the value to be used to color a rectangle in an image. The
default behavior of {cb} is to assume the input is of the form
generated by {banner -b}, in which case it produces a graphical
rendering of the text, such as the following:


acid.gif/


The rectangles used to render the input values may be sized by supplying
parameters to control the rectangle size.


acid-large.gif/


The fun begins when the other features of {cb} are employed:

Flags:
-m 	Interpret input as possible decimal and hexadecimal numbers
	(in 0xBADC0C0A format). Value assigned to pixels for hex strings is
	the hex value. Value assigned for other non-hex strings is the sum of
	the ascii values of the chars in the string

-l 	Take the logarithm (base 10) of the value input (or calculated from
	the -m flag)

-h 	rectangle height in pixels

-w 	rectangle width in pixels

-x $	crop output image to be $ pixels wide

-y $	crop output to be $ pixels wide

-c	generate color output (default is B&W)

There are two primary avenues for fun with {banner} and {cb}
that I have explored, and doubtlessly a countably finite number of side roads.
One direction is to pass your data through {banner -b}, then perform
some processing on the ’1′ ’0′ bitmap, subsequently passing the results to
{cb} for rendering. An example:

banner -b '{dorkbot-nyc}' | sort | sed 's/0/p/g' | sed 's/1/0/g' | sed 's/p/11/g'
| cb -h 10 -w 10 -c > dorkbot-nyc-b.gif



dorkbot-nyc-b.gif/

The above image has been scaled (down) to a width of 555 pixels within your browser

When input arbitrary text strings, rather than just ’1′s and ’0′s, combined
with the “-m” flag, interesting text and binary layourtproperties can be revealed. The
following is generated by passing the source code for {banner} though {cb}
with the “-c”, “-m” and “-x 10 -h 10″ flags:


source-banner-cm.gif/

Applying the “-l” flag serves to threshold some of that information:


source-banner-cmlog.gif/

Tags
Conversation
Related Tags
Comments
Trackback


Leave a Reply

You must be logged in to post a comment.

This entry was posted on Sunday, March 16th, 2003 at 2:03 pm. You can follow any responses to this entry through the RSS 2.0 feed. If you're wondering how to get your own icon next to your comment, go visit gravatar.com and get yourself hooked up.
 steal compass, drive north, disappear...