views:

80

answers:

1

I have an image having dimension 1000*500 I want to make it of 400*300 But My image should not looked distorted.

http://www.daniweb.com/forums/thread295652.html - i used this as a reference. But My image get distorted.

+5  A: 

Your target image size has a different aspect ratio to that of the original. The original is 2:1 but the target is 4:3.

You can resize preserving the aspect ratio, but depending on which dimension you choose you'll either get an image that's 400 x 200 or 600 x 300.

If you need the image to be 400 x 300 then you'll need to resize to 400 x 200 and then add border to each side or 600 x 300 and add the border to the top and bottom.

ChrisF
@ChrisF: Thanks. Better if you explain things in broader way. I am still confuse.
alis
@alis: Aspect ratio is easier to understand with examples. I suggest you have a read of http://en.wikipedia.org/wiki/Aspect_ratio_%28image%29
MattH
@alis. An image's aspect ratio is the proportion of it width to its height -- expressed mathematically as height/width or width/height. If the target image has a different ratio than the source image, then the results will be distorted. There are a number of different ways to preserve the aspect ratio depending on what suits your application. @ChrisF's answer describes a couple of common ones.
martineau