09-15-2017, 04:33 PM
It's hard to predict the size of a JPEG. It depends on the image contents (a blurry image compresses better than a sharp one). IMHO your best bet is to use a script based on ImageMagick's convert that produces progressively smaller sizes by reducing the JPEG quality, and stops once the size is below your limit.