Twitter also announced their use of guetzli for better image quality:
Starting today, Twitter will preserve JPEGs as they are encoded for upload on Twitter for Web. (Caveat, cannot have EXIF orientation)— Nolan O'Brien (@NolanOBrien) December 11, 2019
For example: the attached photo is actually a guetzli encoded JPEG at 97% quality with no chroma subsampling.https://t.co/1u37vTopkY pic.twitter.com/Eyq67nfM0E
Install guetzli and use it like so:
guetzli input.jpg output.jpg
The only caveat is you can't compress PNG with transparency. Sometimes guetzli also made the resulted image size larger, fallback to ImageOptim.