When scaling are pixel sizes always rounded UP?
Posted: 2014-09-01T04:55:59-07:00
Here's a quick dumb question for you:
Given an image with dimensions 1600 by 900, when I resize it with -resize 500x500> then I get an image that is 500 by 282. That is, the height is rounded up to the nearest pixel rather than rounded to the nearest whole pixel (which would have been 281). In my app I need to be able to predict the scaled image size given the source size and the bounding box without loading the file.
Can I assume that for output images, fractional sizes are always rounded up?
Given an image with dimensions 1600 by 900, when I resize it with -resize 500x500> then I get an image that is 500 by 282. That is, the height is rounded up to the nearest pixel rather than rounded to the nearest whole pixel (which would have been 281). In my app I need to be able to predict the scaled image size given the source size and the bounding box without loading the file.
Can I assume that for output images, fractional sizes are always rounded up?