4 Replies Latest reply on Dec 3, 2012 1:19 PM by dutotone

    Resize a layer to maximum height OR width

    dutotone Level 1

      Hi

       

      I'm making an action that I'm going to batch apply to a lot of images.

       

      However I've hit a snag, I need to resize a layer with variable width/height to fit within a certain width/height while constraining ratios. Say I need a layer to be a maximum of 1000px high OR a maximum of 2000px wide, whichever comes first. I need the layers to either increase or decrease in size to fit the "frame".

       

      If what I want is unclear - please ask! I very much appreciate any ideas as to how to go about this.

        • 1. Re: Resize a layer to maximum height OR width
          Noel Carboni Level 8

          Do you need to automate this on multiple images?  The Image Processor script (accessible in Photoshop CS5 and newer via File - Scripts - Image Processor) can resize images to fit maximum H and V dimensions.

           

          I think it can even work on open documents, but I'm not sure whether it can work on the current open document alone.

           

          I'm sure there's a scripting solution that could allow you to do it on an open Photoshop document, but I'm not familiar with any easily obtained offhand.

           

          Note that the Image Processor script can run an action - perhaps you can find a way to combine it with your action.

           

          -Noel

          • 2. Re: Resize a layer to maximum height OR width
            dutotone Level 1

            Hi

             

            Thanks for you answer. I need to resize layers within a document, not the entire psd. And

            I need to to this with close to 400 files.

             

            As a plan B I have already tought of exporting layers to separate files and then resizing

            these using 'Dr Browns Image Processor Pro script'. Then automatically placing

            them and aligning them again. It will work but it's a bit of a workaround - will take some

            time to do.

             

            I'm still open to suggestions, but I suspect it's not doable without a custom script. Unless

            someone thinks of a brilliant combination of commands that will achieve this..

            • 3. Re: Resize a layer to maximum height OR width
              Paul Riggott Level 6

              You can resize selected layers with this script...

              http://www.scriptsrus.talktalk.net/ResizeLayers.htm

              Not sure if it will meet your needs though.

              • 4. Re: Resize a layer to maximum height OR width
                dutotone Level 1

                Paul Riggott,

                 

                Great tip! The only problem with it is that it's not able to determine if a layer have a landscape or portrait orientation. But I can certainly use this if I split the action in two, running one on portrait orientation layers and one on landscape orientation layers. It will make it easier to resize multiple layers atleast.