GET OFF YOUR PHONE!

Heads up!

Look at the sun.

Appreciate the light.

Come back when you are on a Lap or Desktop.

(This page would also drain your mobile data, trust me)
F a r n F r e u n d/ │ F E E D/

Binary Prisma #0

25.07.25

In this script I have the machine iterate trought he RGB values of each pixels, bit by bit.

After translating each RGB tuple [R,G,B] to its sequence of 24 bits, the script iterates trough each bit, switching the pixel on or off depending on the bits value:

1 = on, display the the full; color, 0 = off, turn the pixel 'off' which means in this case not off but turning it to RGB black = [0,0,0]

Processing code:

PImage src;
int index; //variable to iterate trough the byte
void setup() {
  size(600, 450);
  src = loadImage("2.jpg");
  src.resize(600, 450);
  index = 0;
}

void draw() {
  src.loadPixels();
  loadPixels();

  for (int i =0; i< width*height; i++) {
    String bin = binary(src.pixels[i]); //create binary from the pixels RGB value
    char light = bin.charAt(index); //get single bit from the byte
    
    //switch the pixel "on" depending on bit value
    if (light== '1') pixels[i] = src.pixels[i]; 
    if (light== '0')pixels[i] = color(0);
  }
  updatePixels();
  index++;
  if (index == 24) index =0; //return to the start of the byte once all bits has been iterated trough
  saveFrame("/flicker2/###.jpg");
   
}

Possible result:

Another approach is to split the 24 bits into the three 8bits, each of which represents one of the three primary colors, and then switch the individual color channels on or off. In this way new, rather strong colors get mixed.

Processing code:

for (int i =0; i< src.width*src.height; i++) {

    int r =int(src.pixels[i] >> 16 & 0xFF);
    int g =int(src.pixels[i] >> 8 & 0xFF);
    int b =int(src.pixels[i] & 0xFF);

    String binR = binary(r,8);
    String binG = binary(g,8);
    String binB = binary(b,8);

 
    char lightR = binR.charAt(index);
    char lightG = binG.charAt(index);
    char lightB = binB.charAt(index);
    //instead of if-looping for 1s and 0s do a weird translation from char back to int 
    //and multiple by orignial color channel
    int lightRint = lightR - '0';
    int lightGint = lightG - '0';
    int lightBint = lightB - '0';

    pixels[i] =color((lightRint*r), (lightGint*g), (lightBint*255));
  }
  updatePixels();

Possible result:

Personally I'm not that big of a fan of trippy, pseudo glitch aesthetics but thats just what keeps coming up whenever I experiment. But in this case it was to be expected. In a way the script holds a prisma in front of each pixel splitting the lightor maybe, in another less blade focused metaphor dissects the image, peels back bit by bit

Interstingly enougha and independent from my dislike for the visuals, the programm shows how the different bits of an color channel hold different weight in shaping the displayed color.

While the first few frames based on the first part of the bit are less noisy and already show the rough shape of the motif, the frames get more noisier the closer the machine gets to the end of the bit sequence. This is - as far as I understand -due to the latter parts of a bit sequence having less weight on the final color.

Think of this way: the first few bits already define the rough position of the color in the RGB Spectrum. Greenish, darkish, or somewhere in the bright red part of the spectrum. The latter bits add more nuance to the color. For example one might look at the difference the colors RGB[255,000,255} and [250,000,250]. A difference made by the last 3 bits of a 8 bit color channel and visually so small, our eyes can barely differentiate it. If you fiddle with the first few bits however, you can suddenly shift that oversaturated magenta to darker and more humble purple:

Chances are. I still mispresented bits and colors but im a simple man and code first and think later.

Some more examples anyway:

Pixels switched on depending the first bit
Pixels switched on depending the last bit

Tags

💬