Let's say I want to convert an image to an exact size, eg: 400x300. The trick is, if the image, due to its aspect ratio, does not fit in 400x300, then place it in there with black borders.
A 900x1200 image would be converted down to 225x300 to retain its aspect ratio, and then given black borders left and right to make it 400x300.
A 1200x600 image, would be converted down to 400x200, and given black borders top and bottom to make it 400x300.
A 900x1200 image would be converted down to 225x300 to retain its aspect ratio, and then given black borders left and right to make it 400x300.
A 1200x600 image, would be converted down to 400x200, and given black borders top and bottom to make it 400x300.
Comment