clarification image

I'd like to have some getAvgValue(Path1) functionality… or SVG-mosaiic-filter or anything with that functionality
Code: Select all
for each pixel on canvas
for each object
check if object is containing pixel(x,y)
store pixel value in array object->pixelvalue
rof
rof
calculate mean color for each object in array
Code: Select all
cache = new image(width,height)
cache.Fill(#fff)
For i = 0 to shapes.length
shapes[i].fill(i)
For each pixel in cache
Number of shape = cache.getImageData(pixel.x,pixel.y...)
Shapepixels[number of shape]+=image.getImageData(pixel.x,pixel.y...)
For each shapepixels
Compute mean
Code: Select all
lastobject = object;
for each pixel on canvas
if lastobject contains(x,y)
...
else
for each object!=lastobject
check if object is containing pixel(x,y)
store pixel value in array object->pixelvalue
lastobject = object
exit for
rof
rof
calculate mean color for each object in array