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.
Page Index Toggle Pages: 1
Connect luminous point (Read 677 times)
Connect luminous point
Jun 19th, 2009, 10:23am
 
I have to draw lines which connect the most luminous point of a color ( ex. green, or RGB/cmyk/ ect. ) from image to an other image ( all images originate from pdf ).
How I can do it?

best regards,
Francesco.
Re: Connect luminous point
Reply #1 - Jun 23rd, 2009, 7:45am
 
you'll have to cycle inside every image with a for cycle looking for the brightest (or greenest, or whatsoever) pixel; something like this should work:
Code:

for(x=imgX; x<imgWidth; x++){
for(y=imgY; y<imgHeight; y++){
if(brightness(pixels[width*y+x])>maxImgBright){
maxImgBright = brightness(pixels[width*y+x];
brightX = x;
brightY = y;
}
}
}


you should probably create a class to store the images and the "brightest point" routine, then you'll simply have to draw lines between every image.brightX and image.brightY point.

ciao!
Page Index Toggle Pages: 1