Optomize how?
- For fastest rendering? <Selected because of your words, "compress them"> (If so, how much are you willing to allow quality to degrade?)
- for some particular image size: compression level, width, height, and colors?
- for something(s) else?
And in this context, what does "optimize them all at once" mean to you?
- use a single script applied verbatim to each image?
- automatically find and load all (or some subset of "all") images into an image editor and allow you to focus only an whatever aesthetic or technical conditions(s) you consider optimum before an automated save back to the server?
- or something else?
Please see I know what I mean. Why don't you?