5 Replies Latest reply on Apr 30, 2015 9:08 AM by JJMack

    Batch image resize/crop




      I have a lot of images that need resizing to a specific size (1920x805) and saving out for web (ideally around 200kb max file size) to be used as hero images on a website.


      Up until now, I have been doing this manually using the following process:


      Create new 1920x805 pixel canvas

      Drag image(s) into canvas, scale proportionately and centrally (holding shift + alt) until they fill the canvas

      Save for web in jpg format, with a quality value of 30


      I am completely new to Photoshop Scripts and Actions. Does anyone know if it is possible to automate this process using either a script or an action or maybe a tool/plugin?


      Any help would be greatly appreciated.



        • 1. Re: Batch image resize/crop
          Chuck Uebele Adobe Community Professional & MVP

          If you want to manually crop each image for the best crop, then I would make an action that crops to that size, no need to drag it to another canvas and scale. Then run run image processor with that action to save as jpg with the quality you want.

          • 2. Re: Batch image resize/crop
            JJMack Most Valuable Participant

            It is easy to do using a script from my Photo Collage Toolkit.   You just need to create a single image Collage template PSD file.

            The PSD must Have a background layer that is 1920x805 pixels any resolution.  Resolution is meaningless on the web.

            The PSD needs a Alpha Channel Named "Image 1" you create this using Ctrl+A Select all then menu Select>save selection>new channel "Image 1"

            Then use menu File>Scripts>BatchOneImageCollage  Point iy at the your template abd a folder of images to create the collage.  You can optionally add a Layer style to the image and stamp the filename one the image  and save it flattened as a jpeg.  The script will always save the collage as a PSD file so you can tweak the images composition.1920:805 aspect ratio is very wide wider than HDTV 16:9 your Aspect ratio is about 16:7 you image need to more Panoramas than normal  Camera 4:3  or 3:2  aspect ratios some digital cameras have a 16:9 option  they would crop well to 1920x805.   The PSD collage have the  full Image as a smart object transform to fit the 1920x805 space you can change the PSD image composition by changing the layers associated transform. The Jpeg option in my script would use a high quality setting like 10



            Photo Collage Toolkit


            Photoshop scripting is powerful and I believe this package demonstrates this A video showing a 5 image collage PSD template  being populates with images:


            The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.

            1. Size the photo collage templates for the print size you want - width, height and print DPI resolution.
            2. Photo collage templates must have a Photoshop background layer. The contents of this layer can be anything.
            3. Photo collage templates must have alpha channels named "Image 1", "Image 2", ... "Image n".
            4. Photo collage templates layers above the background layers must provide transparent areas to let the images that will be placed below them show through.


            There are twelve scripts in this package they provide the following functions:

            1. TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
            2. CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
            3. LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
            4. InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
            5. ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
            6. ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well.
            7. PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
            8. BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
            9. BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
            10. BatchPicturePackage.jsx - Used to Automatically Batch Populate Any Photo Collage template with an image in a source image folder
            11. PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
            12. PCTpreferences.jsx - Edit This File to Customize Collage Populating scripts default setting and add your own Layer styles.


            Documentation and Examples

            • 3. Re: Batch image resize/crop
              sholtby Level 1

              That is exactly what I was looking for. Life saver!! Thank you very much

              • 4. Re: Batch image resize/crop
                sholtby Level 1

                Is it possible to batch resize a folder with subfolders of images? Ideally preserving the folder structure with the outputted files too?

                • 5. Re: Batch image resize/crop
                  JJMack Most Valuable Participant

                  It would be possible to modify my scripts to add that support. However your new to Photoshop. Photoshop Scripting is not something you want to tackle without a good knowledge of how Photoshop works and a programming skill set and know or can hack at javascript code.


                  There are Image Processor Script that can process image trees and create output image. There Scripts can be configured to include Action you create in the processing.  Action are easier to create than Scripts. You more or less record steps you perform in Photoshop.   Actions however can not use logic without the use of some Photoshop scripting.  To fit any image to your wide aspect  ratio 1920x805 using an action is beyond most action creators skills.   I have put together some tips to help user craft actions that will work well.   Again good knowledge of Photoshop is required to be able to craft complex actions that will work on just about any document. It is difficult or complex to deal with different document sizes and resolution with an action.


                  Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.