im trying to resize bufferdImage in memory in java but to keep the aspect ratio of the image im have something like this but this is not good
int w = pictu
You may have a look at perils-of-image-getscaledinstance.html that explains why getScaledInstance(), used in some of the answers, should be avoided.
getScaledInstance()
The article also provides alternative code.