Hi,
I'm trying to make a script that will read the average color value of a set of pixels in an image. The user will be able to set the square amout of pixels to be read.
Kind of like the mosaic filter but I want to be able to just get the color values.
So far I have just made 4 for-loops as following:
for py = 0; py < picturesizeY; increase py by square value
for px = 0; px < picturesizeX; increase px by square value
for y = py; y < py + square Value;
for x = px; x < px + square Value;
getPixel(x, y);
}
}
}
}
This is increadably slow. I saw in the reference that there is a function that will read the average color in a rectangle. How would I go about using that instead (and is it faster)?
I want to read the pixel values of the image but not draw on the actual image.
Hope this makes any sense to you all.
Grateful for help!