0

I have a set of images, all of which have quite different resolutions from each other. I want to first crop them in the ratio 2:1 and then resize them to 1000x500 so that the image is not stretched or distorted in any way. I used different image resizer programs to do it but I am able to process only a few images at a time whose lengths are approximately equal. I want a software or a piece of PHP or Java code to process all of the images at once and crop them all in the ratio 2:1 in the center. Any help would be greatly appreciated as I need this often.

6
  • 3
    Just to confirm: if you had a 4000x4000 image, you would want to first crop it to 4000x2000 (how do you choose where to crop - centre of the image?) and then resize that to 1000x500?
    – Philip Kendall
    Nov 22, 2021 at 17:26
  • GraphicConverter can do all that.
    – Tetsujin
    Nov 22, 2021 at 18:17
  • @PhilipKendall, Yes, you got it right. I mean exactly that.
    – Asmat Ali
    Nov 22, 2021 at 18:38
  • 1
    This is a nice little programming project. Since you mention PHP and Java, why don't you just write your own piece of software?
    – osullic
    Nov 22, 2021 at 22:40
  • 2
    The canonical answer to this is to use ImageMagick in a shell script (IM also has PHP and Java bindings, if necessary).
    – xenoid
    Nov 23, 2021 at 9:40

2 Answers 2

1

PHP has the imagecrop and imagescale functions, so it should be trivial to cobble together a loop to process a batch of files.

0

Have you ever looked into Photomechanic?
https://store.camerabits.com/

2
  • As written, this is a link-only answer. Please provide a summary of the link destination, or example of how the linked program solves the specific question asked by the OP. Please see: Your answer is in another castle: when is an answer not an answer?
    – scottbb
    Dec 3, 2021 at 1:44
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review Mar 8 at 15:57

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.