Which image formats do you intend to use?
Lossy compression makes the resulting file size hardly predictable, so a fairly convoluted Scripting approach might be an option for jpgs for example.
It has come up previously but I’m not sure I ever saw a finalised Script for the task, basically the Script have to save, check size, if size does not meet intended value: save with different settings, check size, etc.
Edit: Also, do you intend to not embed the Color Profile?
Europe, Middle East and Africa