How to change the aspect ratio of an image while maintaining its area? I would like to know the math behind it because I can't make any sense of it.
Example: image with $h = 128$, $w = 128$, area $= 16384$, ratio $= 1:1$.
When ratio is $1:2$, it becomes $h = 90.51$, $w = 181.02$, area $= 16384.1202$.
How to achieve this mathematically?