On 01/12/11 02:37, Brion Vibber wrote:
I tried File:Rajpoots_2.png, a 10MP engraving scan which is a subject of bug 24889 about Moiré patterns: https://commons.wikimedia.org/wiki/File:Rajpoots_2.png https://bugzilla.wikimedia.org/show_bug.cgi?id=24889
At the given default settings I think it does a better job than current ImageMagick, while still not perfect: < https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&wi...
< https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&wi...
The sharpening makes the image "pop" a little nicely, but the Moiré pattern is (somewhat) reduced regardless of that setting. Still not nearly as nice as a non-decimated scale down with ImageMagick (which we don't use).
That's interesting. Many images seem to look slightly more blurry with block averaging, for example this one from bug 32721:
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Chicago_small.jpg&width=640&sharpen=0.8
Look at the tall buildings near the centre. And several buildings actually acquire a mild horizontal Moire fringe pattern in VIPS which is not there in ImageMagick.
It probably depends on how the spatial frequency spectrum of the block average aligns with the spatial frequencies in the source image. A moving average strongly suppresses certain frequencies which have a period near the block size:
http://ptolemy.eecs.berkeley.edu/eecs20/week12/freqResponseRA.html
That would explain why in your test image there's a horizontal band in the middle of the sky where the fringes are completely suppressed, but above and below they are visible. If you make the block size 1.5 times larger:
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&width=480&sharpen=0.8
then the fringes in that band become highly visible.
Enabling bilinear filtering causes HUGE HORRIBLE artifacts, and is definitely not a good thing for that sort of image. :)
At this reduction factor it's equivalent to nearest-neighbour.
-- Tim Starling