Resize and optimize images outside of the website because a web server is not designed to perform such operations. This saves bandwidth and lightens the load on the processor(s) and RAM.
If the image uploaded directly to the CMS is 7 KB, you will save: - 7 MB of bandwidth with it is sent - 100 KB when the result is viewed - 6.9 MB of storage on the server’s hard drive
And that is without mentioning CPU and RAM usage.