Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I have a pack of rectangular pictures (some landscape, some portrait) but I need them to be square.

I know how to use imagemagick for resizing and converting.

example1 example2 example3

Some of the pictures are wider, some of them higher; but I really don't know how can I make my pictures square in bulk?

Any help/ideas for my issue?

share|improve this question
1  
Are you talking about making each image the same width and height? Or are you trying to compensate for perspective in each image somehow? –  Mr.Wizard Oct 19 '11 at 18:40

2 Answers 2

up vote 3 down vote accepted

In general you have three basic possibilities:

1) Increase your picture's dimensions (on the shortest side) to make it square (As Lauren suggested)

2) Crop them to be square (As DA01 suggested)

3) Stretch your images to fit a square

All three of them have their pros and cons of course.

The first one makes it square, but it adds useless "information".

The second technique takes away some of your picture, and you may lose some "information".

The third one keeps everything but it makes it look distorted and strange.

There are of course more complicated options such as extracting your object and then standardizing a background or faking the background by extending it.

If you are the photographer, then I would suggest setting up a system when you take the pictures of your objects and leave plenty of room around your object so that you can crop it square later.

However, if there as the pictures you are using, then it shouldn't be a hassle to use either of the above techniques.... here's an example of the first three, respectively.

Extra background:

enter image description here

Cropped:

enter image description here

Stretched:

enter image description here

In addition to that (again, given that these are the actual pictures) it's important to remember what you're using these images for. If you're selling furniture, it's best that you don't stretch the image in any way, as it may make the furniture seems smaller/larger or more out of proportion than it really is. The second technique works great if you can simply crop out the background, and if that's not an option then adding a background to expand the image may be your best bet.

share|improve this answer
    
never stretch since you are dealing with products. The customer will think that in this case the products are a tat wider then they are in real life. You do not want to "deceive" your potential clients. Best way is the second suggestion. You could also use the rectangle selection tool and select the part that you want while holding shift –  Luuk Oct 20 '11 at 12:02

I don't know how to do it in imagemagick in particular, but here's how I'd do it in Photoshop:

  • Find your widest dimension. For sake of argument, we'll say 600px.
  • Find your tallest dimension. For sake of argument we'll say 600px.
  • Create an action: Canvas Size, Width 600px, Height 600px, fill background with white.
  • Batch.

Your photos will have extra white space in one dimension or another, but they will all be square.

share|improve this answer
    
yes, it's a solution, but i don't want to have extra white space. But thank you for the idea. –  RusAlex Oct 19 '11 at 17:39
1  
If you don't want white space, then do the same thing but instead of finding the widest dimensions, use the narrowest ones and crop. –  DA01 Oct 19 '11 at 20:35
    
I figured the OP needed all the content, or s/he would have done that already. –  Lauren Ipsum Oct 19 '11 at 21:00
    
@LaurenIpsum I dont think OP's avatar is so inaccurate that you need to say "s/he". But you got me laughing so it's all good. –  Joonas Oct 20 '11 at 6:36
    
One never likes to assume. :) –  Lauren Ipsum Oct 20 '11 at 11:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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