Page MenuHomePhabricator

Improve JPG sharpening algorithm
Closed, DeclinedPublic

Description

From bug 51370c2 (Eduard):

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.


Version: unspecified
Severity: enhancement

Details

Reference
bz51449

Related Objects

StatusSubtypeAssignedTask
DeclinedNone
DeclinedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:03 AM
bzimport set Reference to bz51449.
bzimport added a subscriber: Unknown Object (MLST).

Are there default options that we can rely upon instead of guessing best settings on our own? It seems 7.36.0 added something that may of use, optimize_coding option; and 7.38 some more. http://libvips.blogspot.it/2013/11/tips-and-tricks-for-vipsthumbnail.html has some info

«$ vipsthumbnail 42-32157534.jpg -o x.jpg[optimize_coding,strip]
$ ls -l x.jpg
-rw-r--r-- 1 john john 3600 Nov 12 21:27 x.jpg
Tiny! About half the size of where we started with no quality loss.»

(Compared to itself, not to imagemagick.)

Note that thumb weight is now a concern, especially on mobile which is an increasing portion of Wikimedia traffic: https://www.mediawiki.org/wiki/Talk:Requests_for_comment/Reducing_image_quality_for_mobile#Fundamentals

Are there default options that we can rely upon instead of guessing best settings on our own? It seems 7.36.0 added something that may of use, optimize_coding option; and 7.38 some more. http://libvips.blogspot.it/2013/11/tips-and-tricks-for-vipsthumbnail.html has some info

«$ vipsthumbnail 42-32157534.jpg -o x.jpg[optimize_coding,strip]
$ ls -l x.jpg
-rw-r--r-- 1 john john 3600 Nov 12 21:27 x.jpg
Tiny! About half the size of where we started with no quality loss.»

(Compared to itself, not to imagemagick.)

Note that thumb weight is now a concern, especially on mobile which is an increasing portion of Wikimedia traffic: https://www.mediawiki.org/wiki/Talk:Requests_for_comment/Reducing_image_quality_for_mobile#Fundamentals

In my test, optimize_coding resulted in a 1.5% saving (Amelia_earhart_received_by_president_coolidge.tif shrunk to 755px). Not ground breaking, but seems like an easy gain. We wouldn't want to use strip as we like ICC profiles.

We looked at vipscaler a few years ago but we are no more interested in it as far as I can tell.