Reduce integer image or video dimensions to an exact ratio, then scale by a target width or height to the nearest whole pixel.
16:9
The other scaled dimension is rounded to the nearest pixel; exact half pixels round up.