Mailing List Archive

VIPS test
A test page for the new VIPS image scaler is now available:

https://test2.wikipedia.org/wiki/Special:VipsTest

You can give it names of images from Commons and it will show a
comparison with a moving divider, with the thumbnail from ImageMagick
on the left, and the one from VIPS on the right.

I'll explain what you would expect to see when using this tool:

For JPEG images, using a sharpening radius of 0.8 will make the VIPS
result roughly match the ImageMagick result, as long as the thumbnail
is reduced to less than 85% of the original width. With not enough
sharpening, the resulting image looks blurry. With too much
sharpening, contrast in fine detail will be unrealistically enhanced
and high-contrast borders will develop "halos".

Above about 50% reduction factor, the block average introduces
artifacts in fine detail, so enabling the "bilinear" option will look
better, and will more closely match ImageMagick. But if the bilinear
option is used with a reduction factor much smaller than that, severe
artifacts will be seen in areas of contrasting fine detail.

At small reduction factors, the main difference between ImageMagick
and VIPS is that VIPS uses a simple block average whereas ImageMagick
uses a more complex windowing function. This leads to minor
differences in fine detail.

What we're looking for out of this test is:

* Confirmation that VIPS is not completely failing fpr some class of
images.
* Suggestions for parameter values (sharpening, bilinear) for various
source and destination sizes. VipsScaler allows these parameters to be
configured depending on source size and reduction factor.

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
On Wed, Nov 30, 2011 at 3:58 AM, Tim Starling <tstarling@wikimedia.org> wrote:
> A test page for the new VIPS image scaler is now available:
>
> https://test2.wikipedia.org/wiki/Special:VipsTest
>
There's a weird bug in this page that causes the preview area to be
255x16px under certain circumstances.

This bug occurs on:
https://test2.wikipedia.org/wiki/Special:VipsTest?file=MediaWiki_database_schema_1-17_%28r82044%29.png&width=636&sharpen=0.8

But not on: https://test2.wikipedia.org/wiki/Special:VipsTest?file=MediaWiki_database_schema_1-17_%28r82044%29.png&width=200&sharpen=0.8

Using bisection, I find that this bug occurs for all widths greater
than 300px, for this particular image. For
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Hack-A-Thon-Brighton.png&width=200&sharpen=0.8
the cut-off is at 200px.

Roan

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
Roan Kattouw wrote:
> There's a weird bug in this page that causes the preview area to be
> 255x16px under certain circumstances.

https://bugzilla.wikimedia.org/show_bug.cgi?id=32720

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
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&width=310&sharpen=0.8
>
<
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&width=640&sharpen=0.8
>

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).

Enabling bilinear filtering causes HUGE HORRIBLE artifacts, and is
definitely not a good thing for that sort of image. :)
<
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&width=310&sharpen=0.8&bilinear=1
>
<
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&width=640&sharpen=0.8&bilinear=1
>

-- brion
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
On 30/11/11 15:37, Brion Vibber wrote:
>
> 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).
>
> Enabling bilinear filtering causes HUGE HORRIBLE artifacts, and is
> definitely not a good thing for that sort of image. :)
> <
> https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&width=310&sharpen=0.8&bilinear=1
>

I've taken a look for the source of the new scaler code, but can't find
it -- can someone give me a pointer to it, so I can take a look at it?

-- Neil


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
On 30/11/11 16:08, Neil Harris wrote:
> On 30/11/11 15:37, Brion Vibber wrote:
>>
>> 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).
>>
>> Enabling bilinear filtering causes HUGE HORRIBLE artifacts, and is
>> definitely not a good thing for that sort of image. :)
>> <
>> https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&width=310&sharpen=0.8&bilinear=1
>>
>>
>
> I've taken a look for the source of the new scaler code, but can't
> find it -- can someone give me a pointer to it, so I can take a look
> at it?
>
> -- Neil
>

Please ignore that -- I've just found it:

http://www.mediawiki.org/wiki/Extension:VipsScaler

http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS

-- Neil


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
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&width=310&sharpen=0.8
>>
> <
> https://test2.wikipedia.org/wiki/Special:VipsTest?file=Rajpoots_2.png&width=640&sharpen=0.8
>>
>
> 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


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
Late addition, just tested VIPS with:

https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.8

and found the non-bilinear VIPS version with its loss of detail rather
disappointing.

Bilinear scaling with sharpen 0.8 I find unacceptable,
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.8&bilinear=1

closest results I had with 0.5:
https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.6&bilinear=1

... but imagemagick is definitely still best.

Is it possible to use VIPS only for oversized images?

Gregor

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
On 22/12/11 10:19, Gregor Hagedorn wrote:
> Late addition, just tested VIPS with:
>
> https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.8
>
> and found the non-bilinear VIPS version with its loss of detail rather
> disappointing.
>
> Bilinear scaling with sharpen 0.8 I find unacceptable,
> https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.8&bilinear=1
>
> closest results I had with 0.5:
> https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.6&bilinear=1
>
> ... but imagemagick is definitely still best.

To me, both of those "bilinear" scaling results look broken. At this
scaling ratio, it's effectively nearest-neighbour, not bilinear. I
think a loss of detail on a single-pixel level is preferable to the
extreme aliasing artifacts caused by nearest-neighbour downsampling.

In this particular image, maybe you could mistake the result of
nearest-neighbour interpolation for contrast enhancement. In images
with more contrast in the fine detail, the breakage is unequivocal.
Try today's featured picture:

<https://test2.wikipedia.org/wiki/Special:VipsTest?file=LaPaDu+Panorama+2010-10-03.jpg&width=300&sharpen=0.6&bilinear=1>

> Is it possible to use VIPS only for oversized images?

We'll probably only use it for TIFFs and large PNGs, not JPEGs.

-- Tim Starling


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: VIPS test [ In reply to ]
On Thu, Dec 22, 2011 at 12:32 AM, Tim Starling <tstarling@wikimedia.org> wrote:
>
> On 22/12/11 10:19, Gregor Hagedorn wrote:
> > Late addition, just tested VIPS with:
> >
> > https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.8
> >
> > and found the non-bilinear VIPS version with its loss of detail rather
> > disappointing.
> >
> > Bilinear scaling with sharpen 0.8 I find unacceptable,
> > https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.8&bilinear=1
> >
> > closest results I had with 0.5:
> > https://test2.wikipedia.org/wiki/Special:VipsTest?file=Fern+Groombridge.JPG&width=300&sharpen=0.6&bilinear=1
> >
> > ... but imagemagick is definitely still best.
>
> To me, both of those "bilinear" scaling results look broken. At this
> scaling ratio, it's effectively nearest-neighbour, not bilinear. I
> think a loss of detail on a single-pixel level is preferable to the
> extreme aliasing artifacts caused by nearest-neighbour downsampling.
>
> In this particular image, maybe you could mistake the result of
> nearest-neighbour interpolation for contrast enhancement. In images
> with more contrast in the fine detail, the breakage is unequivocal.
> Try today's featured picture:
>
> <https://test2.wikipedia.org/wiki/Special:VipsTest?file=LaPaDu+Panorama+2010-10-03.jpg&width=300&sharpen=0.6&bilinear=1>
>
> > Is it possible to use VIPS only for oversized images?
>
> We'll probably only use it for TIFFs and large PNGs, not JPEGs.

It looks like VIPS might also help to resolve
https://bugzilla.wikimedia.org/show_bug.cgi?id=24854 ("Black/striped
thumbnails of CMYK JPEGs").

See e.g. https://test2.wikipedia.org/wiki/Special:VipsTest?file=Coding_Shots_Annual_Plan_high_res-5_-_retouch_for_WMF_annual_report_2010-11.jpg&width=640&sharpen=0.8
/ https://commons.wikimedia.org/wiki/File:Coding_Shots_Annual_Plan_high_res-5_-_retouch_for_WMF_annual_report_2010-11.jpg




--
Tilman Bayer
Movement Communications
Wikimedia Foundation
IRC (Freenode): HaeB

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l