Last modified: 2013-07-25 18:40:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53370, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51370 - Determine default settings for VipsScaler extension deploy to Wikimedia wikis
Determine default settings for VipsScaler extension deploy to Wikimedia wikis
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
VipsScaler (Other open bugs)
unspecified
All All
: Immediate blocker (vote)
: ---
Assigned To: Bawolff (Brian Wolff)
:
Depends on: 51275
Blocks: 28135
  Show dependency treegraph
 
Reported: 2013-07-15 16:07 UTC by Greg Grossmeier
Modified: 2013-07-25 18:40 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Greg Grossmeier 2013-07-15 16:07:50 UTC
The default settings for Vips make a huge difference on performance and functionality (obviously), and we have reports of some functionality not being complete with the Vips extension (or VipsScaler itself).

We should determine where exactly we want VipsScaler to be used in WMF production environments and where we want to fall back to imagemagick (the old/current way).

We can start off conservative and add functionality as we go/feel comfortable.
Comment 1 Bawolff (Brian Wolff) 2013-07-15 21:53:12 UTC
I would suggest starting off, only scaling PNG files bigger than say 35MP. This would make it only affect files that essentially already don't work, and thus is unlikely to garner any criticism. (Technically the PNG scale limit is 50MP currently, but things start to get expensive a bit before that, and I think there are some images in the 35-50 MP range that run into memory limits, but don't quote me on that).

Something like (untested):
$wgVipsOptions = array(
        # Sharpen jpeg files which are shrunk more than 1.2
        array(
                'conditions' => array(
                        'mimeType' => 'image/png',
                        'minArea' => 3.5e7,
                ),
        ),
);

Possibly also with the bilinear option (not sure about that)
Comment 2 Eduard Braun 2013-07-15 22:11:00 UTC
Regarding PNGs:
I'd favor this solution as for the problems discussed in bug 51400. When the scalers are fixed and optimum settings are found Vips can still be activated for smaller graphics.


One question regarding JPGs:
You apply sharpening depending on how much they are shrunk. Have you tried to use a continuous function for the amount of sharpening instead of discrete values at fixed steps (as also indicated in the source code comment above)?

Without having done any tests I could imagine this would yield more consistent quality for all sizes.
Comment 3 Bawolff (Brian Wolff) 2013-07-15 22:13:20 UTC
I wonder if it should be enabled at all for jpegs. AFAIK we don't generally have problems with memory usage on jpegs (except for progressive jpegs, where VIPS doesn't seem to do any better)
Comment 4 Greg Grossmeier 2013-07-16 17:17:22 UTC
(In reply to comment #1)
> I would suggest starting off, only scaling PNG files bigger than say 35MP.

Agreed.

> Possibly also with the bilinear option (not sure about that)

Jan: Can you comment on the bilinear aspect here?

(In reply to comment #2)
> One question regarding JPGs:
> You apply sharpening depending on how much they are shrunk. Have you tried to
> use a continuous function for the amount of sharpening instead of discrete
> values at fixed steps (as also indicated in the source code comment above)?

Let's think about this in a longer term bug for improving VipsScaler. Logged as bug 51449.
Comment 5 Greg Grossmeier 2013-07-16 18:34:23 UTC
Brian or Jan: Could one of your propose the merge needed to enable VipsScaler (with the above settings) so we can get it reviewed and ready to merge before Thursday's deploy? Thanks!
Comment 6 Greg Grossmeier 2013-07-18 03:57:07 UTC
Brian/Jan: Hi :-)

Got something for tomorrow's deploy? Kinda need it in the next 13 hours :)
Comment 7 Gerrit Notification Bot 2013-07-18 20:17:49 UTC
Change 74514 had a related patch set uploaded by Brian Wolff:
Proposed settings for VIPS.

https://gerrit.wikimedia.org/r/74514
Comment 8 Bawolff (Brian Wolff) 2013-07-18 20:23:32 UTC
(In reply to comment #6)
> Brian/Jan: Hi :-)
> 
> Got something for tomorrow's deploy? Kinda need it in the next 13 hours :)

Hopefully not too late, but this is what I would propose. In my tests, bilinear made some pngs worst (ex File:Solar-system.png), and some pngs better. At this point it seems like it would be better off initially to enable it only for large pngs, with bilinear off. We could change it later if people want to do something different.
Comment 9 Philippe Verdy 2013-07-20 22:18:27 UTC
Given that the motivation is to allow direct display of reduced images in Wikis, as well as possible integration of a smooth scaler or navigator in the same original image (without needing to upload various derived images with reduced scale, and improve the quality of these thumbnails, VipsScaler should effectively be used for now only on large images.

But I don't see why it should not apply to JPEG images (notably large panoramas, or high-quality facsimile or photos of artistic paintings or books, architecture, or biological species to inspect anatomic details, or aerial photographies and beautiful maps : PNG is not the best format, but may be we'll need support for WebP, which combines PNG and JPEG advantages including for lossless compressions; many high-qulity photographs are also in TIFF format, and we should support images formats that use more than 8-bit color planes, as they allow fine tuning to exchibit shadows or adapt them more easily for color blinds or for some rendering devices, notably for printing or display on various types of LCD panels).

I also hope that VIPS correcntly handles the embedded ICCM color profiles, and that it will preserve the alpha channels (something missing to GIF and JPEG but present in PNG, and raw BMP images).

May be viewers of Wikimedia sites should have an option to select the image format they prefer in their browser. The scaler should then be able to produce other formats than just PNG or JPEG (e.g. WebP saves them lots of bandwidth, notably for mobile users that don't benefit of flat rates for their data plan, and whose connection are frequently much slower than DSL and fiber accesses), according to capabilities reported by their browser or according to user preferences if they disable some formats causing problems for them (PNG, GIF and JPEG generally work, except the full alpha channels and color profiles in PNG).

Another need is to allow rescaling any image to show only a fragment of it (by optional wiki parameters in the [[File:]]/[[Image:]] inclusion tag).
Comment 10 Bryan Tong Minh 2013-07-20 22:31:38 UTC
(In reply to comment #9)
> 
> But I don't see why it should not apply to JPEG images 
Because we can already scale those without running out of memory with our current scaler.
Comment 11 Philippe Verdy 2013-07-20 22:37:16 UTC
Note that VispScaler has severe problems in its bilinear filter. Test this with this quality image:

File:Rotonde Villette interieur.jpg

Look at the strokes bordering the windows, and color artefacts on them.

Applying the bilinear filter is MUCH worse than when it is disabled in the test wii.
Comment 12 Gerrit Notification Bot 2013-07-25 18:38:00 UTC
Change 74514 merged by jenkins-bot:
Settings for VIPS.

https://gerrit.wikimedia.org/r/74514
Comment 13 Greg Grossmeier 2013-07-25 18:40:48 UTC
Done. Thanks Brian.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links