ImageMagick
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including GIF, JPEG, PDF, PNG, SVG and TIFF.
I've used it in many projects to optimize images for different platforms and different sizes on the fly. The resulting images where then cached in the CDNs for faster access.