Quoting "Luis A. Florit" <[EMAIL PROTECTED]>:

> http://w3.impa.br/~luis/fotos/lixo/grid_blurred.jpg
> You can see three problems:
> 1) The old 1-pixel-down shift.
> 2) The two dark bands (20 lines each) at top and bottom of the image.
> 3) Even much intriguing is the grey band right below the top one,
>     also of 20 lines! And it is homogeneous (no likes inside)...
> My 'solution' (change 'x1, y1,' in line 241 by 'x1, y1+1,')
> took care of the shift, but not of the banding.

The dark bands can be attributed to the fact that the averaged region  
near the borders is "filled out" by effectively duplicating the row or  
column at the edges. The algorithm may not be optimal, but it works as  
one should expect.

The average is currently produced by a formula similar to:

sum (v-2, v-1, v, v+1, v+2) / 5

Near the borders, when there is no value "v+2" available, for example,  
you end up with:

sum (v-2, v-1, v, v+1, v+1) / 5

And the next pixel will be:

sum (v-2, v-1, v, v, v) / 5

If you wish to improve the algorithm, I would suggest that you need to  
discard terms and adjust the denominator accordingly -- the last  
example shown should produce "sum (v-2, v-1, v) / 3".

At least, that is my recommendation. I am not a mathematician.
Gimp-developer mailing list

Reply via email to