It's possible to run mozjpeg, pngquant etc.. on the browser (emscripten), to offload servers from this job<p>Example: <a href="https://caub.github.io/misc/optim" rel="nofollow">https://caub.github.io/misc/optim</a>
For a small scale offline alternative I can heartily recommend <a href="https://imageoptim.com" rel="nofollow">https://imageoptim.com</a>.<p>So simple, yet so effective.
the chrome team released a similar tool a few months ago (<a href="https://squoosh.app" rel="nofollow">https://squoosh.app</a>). I'm curious how these compare.
Take a look at <a href="https://kraken.io" rel="nofollow">https://kraken.io</a> as well. Emphasis is on consistency of results and likeness to the original.