I have used ImageOptim, but really prefer https://tinypng.com. or tinyjpg.com. You can open either one, upload your image whether jpg or png to either one and it will make the conversions. Smaller than imagOptim.
Jpgs tend to run about 10% smaller than png’s, but if you want transparency, go with png.
Conversions often run as high as 85% reduction with no noticeable visual degradation.
I do a lot of my initial work with images at 300dpi, you can do more image enhancement than you can if you start at 72dpi, then tinyjpg or tinypng does the final conversion to 72 dpi, but with a lot of the benefits of 300 dpi quality. This is assuming that the initial image is high quality enough to benefit from 300dpi. Some may disagree but I have been working with Photoshop/now Pixelmator since 1993. Your results may vary