I want to scale images to fit with in some predefined size without affecting the actual image’s aspect ratio.
Do we have any predefined algorithms for that in java?
Update:
Resizing Like this. The output is the same image but in smaller size. The outside frame is just a mark.

you’re going to have gaps in either the width or the height… the question is figuring out which.