An Experiment in Text as Numbers and the Library of Babel

harry potter and the philosopher's stone.png

The above image is ‘Harry Potter and the Philosopher's Stone’. Whilst browsing the internet I came across the website ‘Library of Babel’. This website contains all possible pages containing 3200 characters, adding up to around 10⁴⁶⁷⁷ books. It works by using a pseudo-random number generating algorithm to produce the books in without needing to store the actual book itself.

Inspired by this website, I had the idea, that instead of using a number generator, to just compress the text down and use that as the index. So I created a program that took text and converted it to a number by treating the text as though it was in a base 75 number system. (a being equal to 0, b being equal to 2 and etc) And then converting that number into base 65535 by using every symbol in unicode to represent a digit. So “Hello World” would become:

This created a similar effect as the website however instead of a pseudo-random number generator, it simply condensed the text down.

This then gave me the idea to convert the text into base 4294967295. And instead of representing each digit as a symbol to represent it as a 32 bit ARGB colour. (4294967295 being the number of colours possible) and then rendering this in processing, creating the above image.

Romeo and Juliet

Romeo and Juliet

Library of Babel: click here
Processing: click here

Parametric Equations

Parametric equations express the points on a curve as a function of a variable. The images above were created by plotting a parametric equations in Processing. The equation was:

The video below was created by drawing lines between opposite points on the curve the equation produces. The colour of the curve changes based on it's length.

Source Code

void setup() {
  size(1080, 720);
  colorMode(HSB, 360, 100, 100);

//parametric equation parameters
float a1 = 100;
float b1 = 1;
float c1 = 100;
float d1 = 50;

//increments corresponding parameter if true and decrements if false
boolean reversed = false;
boolean reversec = false;

//time modifier
float tMod = 0;

void draw() {
  //draw lines
  for (float t = tMod; t <= 0.005 * 5 + tMod + 0.004; t+= 0.005) {
    //first point
    float x1 = (cos(a1*t)-cos(b1*t)) *100 + width/2;
    float y1 = (sin(c1*(t ))-sin(d1*(t ))) * 100 + height/2;
    //second point
    float x2 = (cos(a1*(t + HALF_PI))-cos(b1*(t + HALF_PI))) *100 + width/2;
    float y2 = (sin(c1*(t + HALF_PI))-sin(d1*(t + HALF_PI))) * 100 + height/2;
    //length of line
    float lengthL = sqrt(pow(abs(x1-x2), 2) + pow(abs(y1-y2), 2));
    //set colour based on length of line
    stroke(map(lengthL - 120, 0, 160, 0, 360), 100, 100);
    //draw line
    line(x1, y1, x2, y2);
  //increase time modifier
  tMod += 0.0005;
  //change some parameters to create more interesting movement
  if (reversec) {
  } else {
  if (c1 > 50) {
    reversec = true;
  } else if (c1 < 1) {
    reversec = false;
  if (reversed) {
  } else {
  if (d1 > 50) {
    reversed = true;
  } else if (d1 < 1) {
    reversed = false;

Wiki: Click Here

Processing: Click Here