Announcement

Collapse
No announcement yet.

Automating aspect ratio size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automating aspect ratio size

    Hey all,

    Just like to say hi, thins is my first post here, I've been wracking my brains over this one. I need to take 100s of jpegs of different sizes and have an action or AppleScript crop them to a specific aspect ratio, say for example 4:3. But I want it to do this regardless of pixel size. So the script would look at the width and then crop the height accordingly to make 4:3

    Any ideas anyone?

    Thanks in advance.

    Scott

  • #2
    Re: Automating aspect ratio size

    In Photoshop, with the crop tool set to 4:3 ratio, create an action that crops an image. Then create a Droplet to batch process your images.

    Comment


    • #3
      Re: Automating aspect ratio size

      This is very risky. Cropping in automation carries a huge risk of losing important detail.

      Comment


      • #4
        Re: Automating aspect ratio size

        Originally posted by Damo77 View Post
        This is very risky. Cropping in automation carries a huge risk of losing important detail.
        No risk. When you create the droplet, specify a destination folder that is different from the source folder. When the droplet runs, it will save the cropped images as copies in that destination folder.

        Comment


        • #5
          Re: Automating aspect ratio size

          I agree with Damo77 auto cropping runs the risk of losing image info that you would normally want to keep. How would a script be able to decide what portion to delete after the initial size by largest dimensions made?

          Your script would need to recognise when an image was in either landscape or portrait format and alternate between 4:3 and 3:4 ratio.

          Not suggesting that it cannot be done, but I suspect not a trivial task. Hope that someone with scripting experience will step forward and demonstrate how

          Comment


          • #6
            Re: Automating aspect ratio size

            Originally posted by Tony W View Post
            I agree with Damo77 auto cropping runs the risk of losing image info that you would normally want to keep.
            After experimenting, I don't think the Droplet method that I suggested would work very well.

            As to risk, there is none if you set up the automated method to save a copy in a different folder. The only risk is that you'd get some crops that aren't satisfactory -- which I think is likely.

            Comment


            • #7
              Re: Automating aspect ratio size

              Originally posted by Sabrina81 View Post
              ...The only risk is that you'd get some crops that aren't satisfactory -- which I think is likely.
              And that is the risk it is nothing to do with file security as you will be outputting to a different folder or have created duplicates to work on.

              The method you suggested did not take into account a number of variables

              We do not know what size or aspect ratio the existing files are. Some may be portrait some may be landscape where do we place the crop to far left or far right or in the middle for landscape. Middle, top or bottom for portrait. What if the crop is 5:4 or 4:5 making it worse for image area loss.

              Attached is perhaps a best case scenario (i.e.losing least amount of image). Original images 3:2, 2:3 ratio (35mm FF digital) where do I want the crop box and how do I get some form intelligence into the script?
              In either of these cases you may argue the crop trivial but I can imagine in the landscape wanting to include more of the tree on the right or even exclude it entirely.
              Attached Files

              Comment


              • #8
                Re: Automating aspect ratio size

                FAR better tool than Photoshop to do this: Lightroom! Faster, totally non destructive, I copy and paste cropping all the time on multiple images, then if off, just move those few manually without losing anything data wise (or time wise).

                Comment


                • #9
                  Re: Automating aspect ratio size

                  Originally posted by Shot8un View Post
                  Hey all,

                  Just like to say hi, thins is my first post here, I've been wracking my brains over this one. I need to take 100s of jpegs of different sizes and have an action or AppleScript crop them to a specific aspect ratio, say for example 4:3. But I want it to do this regardless of pixel size. So the script would look at the width and then crop the height accordingly to make 4:3

                  Any ideas anyone?

                  Thanks in advance.

                  Scott
                  Would you care to weigh in with some additional information in light of the replies you've received so far?

                  You specified one aspect ratio -- 4:3. That ratio is landscape mode (aspect ratios are typically expressed WIDTH:HEIGHT). Are all of your images in landscape mode? Or are some in portrait mode? If you want them cropped to portrait mode, that would be 3:4, so your automated method would have to distinguish between portrait and landscape mode.

                  A lot of people here are trying to help you. Would you do us the courtesy of replying? Thanks.

                  Comment


                  • #10
                    Re: Automating aspect ratio size

                    Morning all,

                    Thank you all for your suggestions. This is a little more complicated than it sounds.
                    I at first assumed that a simple droplet action would work but it doesn't.
                    The action (on setup) records the pixel dimensions of the setup image and then applies them to everything you run the droplet on.
                    The images are all landscape but different pixel dimensions, so I needed the action/script to take the longest edge and calculate the hight variable to make the image a specific aspect ratio.
                    I've found the solution (finally) in a java script that can be built into a droplet/action to do the cropping.

                    Thanks to everyone who commented

                    Scott
                    Last edited by Shot8un; 04-21-2017, 02:02 AM.

                    Comment


                    • #11
                      Re: Automating aspect ratio size

                      What's significant about the 4:3 shape?

                      Comment


                      • #12
                        Re: Automating aspect ratio size

                        Originally posted by Shot8un View Post
                        I've found the solution (finally) in a java script that can be built into a droplet/action to do the cropping.

                        Thanks to everyone who commented

                        Scott
                        If that script writes anything to disk, make sure you back things up before trying it out. I know you haven't used such a thing before, because you referred to it as a "java script" (java and javascript are two totally different languages, so you're actually using a javascript script). It's good to be cautious with anything that writes to files.

                        Comment


                        • #13
                          Re: Automating aspect ratio size

                          Originally posted by Damo77 View Post
                          What's significant about the 4:3 shape?
                          I just used that as an example, I need to take several 1000 images and crop them to 3:2 for a website.... problem being they are all different sizes.

                          Fortunately the JAVASCRIPT SCRIPT worked quite nicely

                          Scott

                          Comment


                          • #14
                            Re: Automating aspect ratio size

                            Originally posted by andrewrodney View Post
                            FAR better tool than Photoshop to do this: Lightroom! Faster, totally non destructive, I copy and paste cropping all the time on multiple images, then if off, just move those few manually without losing anything data wise (or time wise).
                            Yes it is a better option which I had forgotten about.
                            It also solves the aspect ratio changes between landscape and portrait images as it can recognise the mode and change automatically so a landscape shot that requires a 3:2 ratio followed by a portrait shot the ratio will change to 2:3 - at least that is what I seem to recall seeing!

                            Comment


                            • #15
                              Re: Automating aspect ratio size

                              Originally posted by Shot8un View Post
                              I just used that as an example, I need to take several 1000 images and crop them to 3:2 for a website.... problem being they are all different sizes.

                              Fortunately the JAVASCRIPT SCRIPT worked quite nicely

                              Scott
                              I'm glad it worked that time, but still be careful with the use of javascript. It has a lot of ill-defined behavior, which can make it very dangerous if allowed to read and write to your disk or link/unlink files.

                              Comment

                              Related Topics

                              Collapse

                              • christine66
                                Batch Resizing?
                                by christine66
                                Is there a way to automate the task of resizing multiple images on the fly in Photoshop 7?

                                Christine
                                02-09-2005, 11:32 AM
                              • arcadhia
                                Batch Images
                                by arcadhia
                                Hi...
                                it has been ages since I came here for the last time..
                                a quick question...

                                let's say I have 1,000 pictures, all different sizes, resolutions even different cameras... and I have to cut, resize, and save with this specs:
                                - 3 x 3 Inches [square]
                                - 150dpi...
                                11-30-2011, 04:44 PM
                              • ebbtide
                                Problem with Cropping of old images
                                by ebbtide
                                Hi, Here's the problem. I have thousands of scanned images of very old document pages that need to be restored using photoshop methods. The first step is to crop and straighten the images, ideally in a batch file. The photoshop automatic crop and straighten function does not work well or mostly does...
                                02-08-2006, 07:16 AM
                              • arcadhia
                                Photo batch help
                                by arcadhia
                                Hi...

                                I have 80 pictures with a range size between 1.5mb to 4mb, how can I reduce them in 1 step to 5"x7" - size for web (kbs)

                                Thanks and happy New Year!!!

                                p.s. What about Flora? still around here?
                                01-16-2010, 02:51 PM
                              • kiska
                                Batch Action question
                                by kiska
                                I need to make an action to change several images from tif to jpg. Also to change the resolution to 72.
                                !. Do I need to record the 'act' of opening the file?

                                2. Is it better to crop and set dimensions of the image BEFORE or AFTER changing res to 72. I realize the crop and dimensions...
                                03-13-2005, 03:12 AM
                              Working...
                              X