One good resource I like for image optimisation is TinyPNG. Don't let the name fool you - it supports JPG and PNG.
Has an API that you can integrate with a few different ways. Found it very useful integrated into content management systems for client websites.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.