0

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?

1
  • 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
    Commented Oct 19, 2011 at 18:40

3 Answers 3

3

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.

4
  • 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
    Commented Oct 20, 2011 at 12:02
  • He asked you how. I wonder how you stretched it..
    – KeyC0de
    Commented Oct 13, 2016 at 18:06
  • Sorry @RestlessC0bra, this is 5 years ago now -- but if I were to stretch something I would use Photoshop and use the content aware scale.
    – Hanna
    Commented Oct 13, 2016 at 19:42
  • Yup. This is exactly what i did, after seeing a YouTube tutorial. Very easy, effective and most efficient.
    – KeyC0de
    Commented Oct 13, 2016 at 22:26
1

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.

5
  • yes, it's a solution, but i don't want to have extra white space. But thank you for the idea.
    – RusAlex
    Commented Oct 19, 2011 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
    Commented Oct 19, 2011 at 20:35
  • I figured the OP needed all the content, or s/he would have done that already. Commented Oct 19, 2011 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
    Commented Oct 20, 2011 at 6:36
  • One never likes to assume. :) Commented Oct 20, 2011 at 11:13
-4

Go to befunkydotcom and that might help solve you're problem. Replace 'dot' with '.'. Dont worry this is not a scam just a photo editor site.

1
  • 3
    Hello user74368, welcome to GD.SE and thanks for your input. Could you please tell us what the website you are referring to actually does? That way, your answer is still of some value in case the link breaks at a later time. We really dislike link-only questions here, exactly because link rot is rampant. Thanks! If you have any questions about the site, have a look at the help center or feel free to join us in Graphic Design Chat once your reputation allows you to (20). Keep contributing and enjoy the site!
    – Vincent
    Commented Aug 15, 2016 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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