Capitaine Archibald Haddock. Doing things with Processig is still a laborious work for me because I'm a newbe in javascript.
In this script, the integers distance is the distance between the analyzed points; the integers zoom is the scale (not zoom, stupid I am) factor for the image from Processing (it's not used in the CF rule). and of course the loadImage("guigui.png") has to be changed in accordance with the image you want to use.
This script is not "strong" and may go crasy, especially if the width of the image is not a multiple of the integer distance.
The result is an image directly made by Processing (for testing) and a file created in your Processing project directory, called "CFpoint.txt".Inside there is a rule called POINTILLISME wich use a rule CIR. The idea is to play in CF with the rule CIR.
But, he he, it's not the end. As I didn't succed to have floating-point numbers with a dot instead of a comma for the decimal point, the comma has to be search an replace in a text editor (or in CF directly)(Btw, if someone has an idea to include such manipulation dirctly in the Processing script ;^) ).
Voilà, here is the script:
/**
* Pointillisme
* par Guigui
*
* chaque point est à 100% lumineux
* (B à donf sur le HSB)
* la luminosité influe sur la taille des points
*
* 29/10/2007
*/
PImage imageSource;
int distance = 3;
int zoom = 7;
void setup()
{
colorMode(HSB, 100);
imageSource = loadImage("guigui.png");
size(imageSource.width*zoom,imageSource.height*zoom);
noLoop();
noStroke();
smooth();
background(0);
}
void draw()
{
String[] CIRCLE = new String[(imageSource.width/distance)*(imageSource.height/distance)+2];
CIRCLE[0] = "startshape POINTILLISME\nbackground {b -1}\n//----------------------------------\n//par Guigui, avec processing…\n//----------------------------------\nrule CIR{CIRCLE{}}\n//----------------------------------\n\nrule POINTILLISME {";
for (int x = 0; x < imageSource.width; x = x+distance) {
for (int y = 0; y < imageSource.height; y = y+distance) {
color pix = imageSource.get(x, y);
float sat = saturation(pix);
float hu = hue(pix);
float taille = brightness(pix)/100*distance;
fill(hu, sat, 100);
ellipse(x*zoom, y*zoom, taille*zoom, taille*zoom);
CIRCLE[(x/distance)+(y/distance*imageSource.width/distance)+1]= "CIR{x "+nf(x,3)+" y "+nf(-y,3)+" s "+nf(taille,1,8)+" hue "+nf(hu*3.6,3,8)+" sat "+nf(sat/100,1,8)+" b 1}";
}
}
CIRCLE[(imageSource.width/distance)*(imageSource.height/distance)+1] = "}";
saveStrings("CFpoint.txt",CIRCLE);
}