ZEZeroGravitas·Sep 28, 2015
There's tools like JpegMini, which tries to detect when artifacts become annoying.
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:
https://github.com/dwbuiten/smallfry
In Perceptual Image Compression at Flickr