Perceptual Image Compression at Flickr
code.flickr.net
code.flickr.net
Based on what criteria, exactly? 606 comparisons is more than enough to rule out large differences, especially considering that the testers were heavily primed to look for even the tiniest difference and making forced-choices about difference or no difference. Less than 1% difference suggests no real difference.
An analogous situation: if someone runs a blood pressure clinical trial, whose results will you believe more - a trial which measures one person's blood pressure on and off a drug several hundred times over a year or two, or a trial which measures several hundred peoples' blood pressure at the beginning and end of the trial? Obviously the latter, because we know that there are big differences between people which must be measured if we want to make reliable predictions about the effect of the drug in the rest of the population, while additional blood pressure measurements of a person only reduces variability a little bit and helps only a little (because most of the sampling error was removed by the first pair of measurements, and further measurements leave the bulk of variance unaffected).
Personally though, I think the linked article about on-the-fly resizing[0] was a more interesting "technical" read.
[0] http://code.flickr.net/2015/06/25/real-time-resizing-of-flic...
Ideally we’d have an algorithm which automatically tuned
all JPEG parameters to make a file smaller, but which
would limit perceptible changes to the image. Technology
exists that attempts to do this and can decrease image
file size by 30-50%.
As far as I know, the only practical way to do this is to do a binary search for the quality level that gives a desired SSIM [1], but this is kind of expensive and I was hoping that they had something cool to tell us here.[1] If you're interested in getting this kind of improvement and your images are viewed enough that it's worth doing more intensive encoding to get things exactly right, you could do this:
def evaluator(image, candidate_quality):
compressed = jpeg_compress(image, candidate_quality)
return dssim(image, compressed)
best_quality = binary_search(
image, desired_dssim, candidate_qualities, evaluator)Do you know if it uses a similar strategy to imgmin?
imgmin finds the lowest-good quality, and jpegoptim optimizes compression at that quality.
I also wonder whether it would be possible to narrow down the range with only a sample of the image (i.e. pick "representative" subregion(s), bisect on that, then try that quality on the whole image).
There's an open source re-implementation of their published algorithm on github, but they have patents, which might be part of Flickr's reticence:
Clearly.
If the 8x8 tiles in a jpg were lossy deduplicated, the Huffman compression should work better, even if you kept the high frequencies.
http://www.dkriesel.com/en/blog/2013/0802_xerox-workcentres_...
I'm waiting to get home to see if they've done to fix this mess.
If Firefox supports webp in the near future...
Where are you getting this? My understanding is FF still doesn't intend to add WebP support. https://bugzilla.mozilla.org/show_bug.cgi?id=856375I wonder how they measured this. Seems like perceived speed gains would be sub-linear with file sizes to me. Particularly as actual transfer speed is often too once you factor in network latency patterns.