There is no built-in functionality to resize an image to a given file size that I am aware of. The size can be reduced by various methods:
- Changing to a compressed file format.
- Shrinking the dimensions of the image.
- Lowering the quality of the image.
The system would need a loop that attempts to resize the image using one more of the above methods, check what the resulting file size is, and then adjust the parameters and try again until the desired size is reached.
A more common way to deal with this is to shrink the dimensions of the image to a height and width that generally yields acceptable sizes and not worry about the exact size of any one file. There are numerous 3rd party libraries that will easily do this (I've used ImageResizer successfully), or try this.