We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › how to get colors from image into noisegrid
Page Index Toggle Pages: 1
how to get colors from image into noisegrid? (Read 984 times)
how to get colors from image into noisegrid?
Sep 17th, 2009, 1:41am
 
hi, how can i get each point with the color of the picture position within this noisegrig?
here what i have:

Code:
PImage img;
int ii,x,y;
float i,j;
void setup()
{
size(310,310);
img=loadImage("g.jpg");
background(255);
smooth();
}

void draw(){
float getcol = map(mouseX, 0, width, 2, 78);
int xx = int(random(img.width));
int yy = int(random(img.height));
color col = img.get(xx, yy);
noStroke();
fill(col);
for(x=1;x<60;x++)

for(y=1;y<60;y++)

ellipse(x*5+n(mouseX+10)*1.5,y*5+n(mouseY-10)*1.5,n(0),n(0));
i++;
noLoop();
}
float n(int k){
return noise(x*0.1+k,y*0.1,i*0.03)*7;
}
Re: how to get colors from image into noisegrid?
Reply #1 - Sep 17th, 2009, 2:11am
 
Something like:
Code:
void draw(){
 noStroke();
 for(x=1;x<60;x++)
 
   for(y=1;y<60;y++)
   {
     color col = img.get(x * 5, y * 5);
     fill(col);

     ellipse(x*5+n(mouseX+10)*1.5,y*5+n(mouseY-10)*1.5,n(0),n(0));
   }
 noLoop();
}
Questioning
Re: how to get colors from image into noisegrid?
Reply #2 - Sep 17th, 2009, 2:24am
 
great! thank you!!! ..it looks like it would first determine the image color grid and later deform it with the noisefield. exactly what i was looking for:) ...shure it needs the same *5 value!
Re: how to get colors from image into noisegrid?
Reply #3 - Sep 18th, 2009, 2:36am
 
hi PhiLho,
i made some experiments with that script and figured out that it would  be another interesting improvement when one could adjust something like a depth, looking like this (i made with photoshop) http://www.flickr.com/photos/lumicon/3929130043/
i tried to make it as pseudo depth with smaller point for each line, but i would also have to diminuish the size of the noisegrid, ...no idea how to do that.
would be nice if you could help. Cry
Re: how to get colors from image into noisegrid?
Reply #4 - Sep 21st, 2009, 4:12am
 
I first tried to change the spacing/size of ellipses by using some kind of geometrical suite, but it might be clumsy/hard to adjust.
So I looked how to make a perspective transformation, I found an algorithm, but I still need some time (in parallel to other stuff) to write something using it.

If I remain silent too long, just bump up this thread, it will remind me to work on this! Wink (as I find the problem interesting in itself).
Re: how to get colors from image into noisegrid?
Reply #5 - Sep 25th, 2009, 3:51am
 
thats really nice! ...i searched for some useful ways to realize it, found this:
http://www.openprocessing.org/visuals/?visualID=2245
here it is made with a z axis turn, looks pretty crazy (to me;), didn't do any 3d processing, will look at it closer.
a bien tôt
Page Index Toggle Pages: 1