I have a frame in which different photos must shrink and fit into (frame size is absolute), and then save into different file names (preferably same name as the file that was fit into the frame). There are a total of 1400 images (with more coming in the future), so its hard to do with hand.

I tried data sets and variables. But that only lets me fit one image into the frame each time (with layer pixel replacement) . As the replacement pixel will only take a file, not iterate through a folder. Also i couldn't find a way to automate this process with actions.

So is there a way to have Photoshop iterate through the files of a folder. Fit them into the frame, then save them with the same name?

  • 2
    Have you tried the File > Automate > Scripts > Image processor ? If you check Resize to fit it will keep the aspect ratio. You could add Action that makes sure that each document has identical width and height with canvas size and then make the document big enough to fit in your frame by using canvas size, place frame above the background and that should do it.
    – Joonas
    Mar 26, 2013 at 12:55

3 Answers 3


You could create an action that resizes the images, then imports your frame onto the top layer and saves out the file.

Then simply create a batch render for the folder that contains your images.

Look for tutorials in creating actions and batch rendering in Photoshop.

  • This is brilliant, thanks so much! I used your action and then ran a script > image processing to save each image out as a jpg. thanks for sharing your solution.
    – Clodagh
    Apr 21, 2019 at 21:48

The tool in photoshop you need is called Batch Processing (file > automate > batch).

You'll first need to create an action, then apply that action to the directory where your images are.

Check out: http://graphicssoft.about.com/od/photoshop/ss/basicaction.htm


I finally found a solution to this after searching and searching with nothing that worked!!!

I always ran into the problem where part of an image would be cropped off if I set up the script to resize off of a horizontal value for example.

Anyway. my solution was this. I created a script that first used the image-trim and only set it to trim to the top and bottom. Then I edit-cut the image and set background color to white (if your images are already on white). Then I resized the canvas to 30" x 30" square which is much larger than any image we will ever have. Then I pasted in place, and pasted in place a second time (this is the key). Then rotate this second (top) image 90º, then set transparency to 50%, and again choose image-trim, but this time set it to trim to all sides. You now have a trimmed image to square, no matter what the original crop orientation!

Also make sure if you have any PSD layered images mixed in to do a flatten image before anything else.

  • 2
    Can you show the script?
    – Mensch
    Sep 8, 2015 at 19:52

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.