Next-gen image formats like JPEG 2000, WebP, AVIF provide additional compression efficiency. Automatically compressing to an next-gen image format with no perceptible change in quality is assisted by integrating device detection and client hints into the optimization process.