Visualizzazione post con etichetta text. Mostra tutti i post
Visualizzazione post con etichetta text. Mostra tutti i post

mercoledì 5 settembre 2012

Scribd: online documents sharing

Today I'm posting about an online text documents sharing service: scribd.
I used that service sometimes (here is my account) I think it's cool, it makes people able to read documents online or to download them.ù
You can easily login using your facebook account and start uploading files or reading online documents.
Probably I'll upload the battlefield 3 guide this weekend or next week.
I know it's a short post but I think scribd it's really user friendly.

Bye, Dami

martedì 31 gennaio 2012

Processing Text-image generator Processing

This is a simple post about a processing sketch that makes you able to generate from a normal image an image like this, formed by letter/numbers of differents colors.




This is the processing sketch:

PImage img;
String txt = "hello"; //here goes your text
float spacex = txt.length()*2.9;

//you should need to recalibrate this variable
float spacey = 5.0;

void setup(){
  img = loadImage("img2.jpg");
  size(img.width*2, img.height*2);
  noStroke();
  background(255);
  smooth();
  }

void draw(){
  for(int xpix = 0; xpix <= img.width; xpix += spacex){
    for(int ypix = 0; ypix <= img.height; ypix += spacey){
      color pixcol = img.get(xpix, ypix);
      fill(pixcol);
      text(txt, int(map(xpix, 10, img.width, 10, img.width*2)), int(map(ypix, 10, img.height, 10, img.height*2)));
      }
    }
    saveFrame("img-text.jpg");
  }


This sketch simply create the image getting the color of the processed pixel and save the final result (saveFrame) as an image.
This sketch can generate from this image:

this image:


I hope you like this post, if you have questions comment or send me an e-mail to damianoandre@gmail.com

Bye, Dami

P.S.:the sketch it's calibrated to wite "0" but if you want to write something else you have to recalibrate some things.