This question is generic. I am not a photographer or graphic artist, or expert with Photoshop. I am a simply a programmer of a website.

I have a generic gallery of images that I have to put in the future site:

enter preformatted text here

My client gives me all the photos and these have a dimension of 5184 x 3456 pixels. I have to resize to 620 x 378, but when I use Ifanview or FreeSizer or Imagemagick for resizing, the resulting photos are resized to 567 x 378 pixels.

Then I want to know that the size of the photos I have to get a new picture of the size 620 x 378 pixels?

Not always is not always correct just a size larger.

What are the precautions I must have in resizing photos?

  • 1
    Do you want the resulting images cropped, stretched, or with a border added? – mattdm Nov 28 '14 at 2:29
  • I want the result images with resolution 620 x 360 but when I resized the result was always 567 x 378 – Mirko Cianfarani Nov 28 '14 at 12:00
  • Let me ask that a different way. Your photos are one shape. You are asking for them to be another shape. How do you envision that happening? – mattdm Nov 28 '14 at 12:03
  • You want the photos to have a wider aspect ratio than they do. Where will that come from? – mattdm Nov 28 '14 at 12:05
  • I do not know where they come from the photos but it seems that meet a certain relationship between them – Mirko Cianfarani Nov 28 '14 at 12:16

The problem you're having is that the images you've been supplied have an aspect ratio of 1.5:1 (5184/3456 = 1.5), but you're trying to resize them to an aspect ratio of 1.64:1 (620/378 ~ 1.64). Hence you're going to have to chop some pixels off the top and/or bottom of the images you've been supplied to get to make them to the wider aspect ratio you need. Specifically in this case, you're going to need to crop the originals to 5184 / 1.64 = 3160 pixels high, or put another way, chop 296 pixels off vertically.

If you want to automate this, you can either chop 296 pixels off the top, the bottom, or anything inbetween (e.g. 148 pixels off both the top and the bottom). However, anything automated has the potential to chop off the "important" bit of the photo, so I'd suggest telling your client to give you source images in the correct aspect ratio.


The issue you are encountering is that the aspect ratio of the original image is different to the aspect ratio of your target image dimensions.

Source image 5184x3456 pixels Aspect Ratio: 1.5   (5184/3456)
Target size   620x378  pixels Aspect Ratio: 1.64   (620/378)

This means that to make the source image fit the target size you'll have to reduce the height of the source image by cropping off 295 pixels.

Then I want to know that the size of the photos I have to get a new picture of the size 620x378 pixels?

Source images with dimensions of 5184x3161 pixels will resize down to your target of 620x378.

What are the precautions I must have in resize photos?

The two main precautions are:

  1. Respect the aspect ration of the source image so it doesn't get squished in the resize. (though you seem to already be doing this from your results so that's fine)
  2. If you're going to automate the cropping of images so their aspect ratio matches your output size, check the results haven't cropped out important details. (You may have have to go back and manually crop such pictures)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.