I was in a need of such a thing and was determined to produce my own version, but then I found out that the C++ image manipulation lib “ImageMagick” has tools for that already. So I took the utility convert.exe and made a batch script to do what I need it to do.
Download the archive below, extract it to a Windows folder and run convertimg.bat (by double clicking), when asked press “I” to install it into registry (for the context menu).
Simple as that and it works great.
Now whenever you will right-click a JPEG file, a context menu entry “Compress” will appear.
If you understand a bit of batch, you can modify the script as you please.
Default compression ratio is 60% (40% less quality). It replaces the source file.