petscii processing

Saw this before going to bed and i  wanted to play with the C64 font. vague ideas, began some things. work in progress.

font used.

the WIP source code for the last pic:

// wip state, by @zproc based on https://forum.processing.org/topic/challenge-processing-variations-of-10-print-chr-205-5-rnd-1-goto-10#25080000001836245

PImage img;
//int d = 25;
int d, n = 45;
PFont font;

void setup() 
{
  size(450, 450);
  font = loadFont("C64Pro-Style-48.vlw");

  d = width/n;
  textFont(font, int(width/n));

  img = loadImage("wg.jpg");
  img.resize(n, n);
}

void draw() 
{
  //int mms = constrain(130*mouseX / width, 50, 230);
  loadPixels();

  for(int x = 0; x < n; x++) 
  for(int y = 0; y < n; y++) 
  {
   float val = (img.pixels[y*n+x] & 255);

    for(int dx = 0; dx < d; dx++) 
    for(int dy = 0; dy < d; dy++) 
    { 

      int z = val % (2) < 1 ?  255 / d :  255 / d;
      //int z = val % (2*m) < m ? (dx+dy+1) * 255 / d : (dx+d-dy) * 255 / d;       if ( val > 2 * abs(z - 25)+ 2 )
      {
        //pixels[ (y*d + dy) * width + (x*d + dx) ] = color(val);
        //fill(0,150,blue(int(val)));
        fill(color(val));
        text("0", x*d , y*d );
      }
      else
      {
         //pixels[ (y*d + dy) * width + (x*d + dx) ] = color(val);
         fill(color(val));
         //fill(0,green(int(val)),0);
         text("1", x*d , y*d );
      }

    }

  } 
  //updatePixels();
}

void keyPressed()
{
 if (keyCode == ENTER)
    saveFrame("C64GDWIP-####.png"); 

}

Leave a Reply

Your email address will not be published. Required fields are marked *