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 & HelpPrograms › applying different filters to a tiled image
Page Index Toggle Pages: 1
applying different filters to a tiled image (Read 309 times)
applying different filters to a tiled image
Jan 5th, 2009, 9:17pm
 
I have tiled and image and aplied an RGB filter to the image but i would like to have a different filter on each tile of the image.

my present code is

//image tile

size (650,450);
PImage img2 = loadImage("ketty.jpg");
tint (10,100,200);
int cols = 4;
int rows = 4;
int w = width/cols;
int h = height/rows;
for (int i =0; i<height; i+=h){
 for (int j=0; j<width; j+=w){
   image(img2, j, i, w, h);  
 }
}

Any suggestions how to change the RGB values for each tiled image?

thanks
Re: applying different filters to a tiled image
Reply #1 - Jan 6th, 2009, 11:22am
 
You just have to call tint() before displaying each copy of the image. Example:
Code:
size(650, 450);
PImage img = loadImage("ketty.jpg");
int cols = 4;
int rows = 4;
int w = width/cols;
int h = height/rows;
for (int i =0; i<height; i+=h){
for (int j=0; j<width; j+=w){
tint(map(i, 0, height, 10, 255), map(j, 0, width, 10, 255), 128);
image(img, j, i, w, h);
}
}
Page Index Toggle Pages: 1