How can I batch-crop a large set of photos so the subject stays centered?
Asked 10/18/2015
5 views
2 answers
0
I have a few hundred studio photos of a model on a plain background, shot from several angles (front, back, side, and full length). I want to crop them in batches so the model ends up centered in each image, but the framing and shooting distance vary from photo to photo. Photoshop batch crop hasn’t worked well because the subject size and position are not identical across the set. Is there a practical workflow for this, either in Photoshop or with another tool, to automate most of the cropping?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
10y ago
2 Answers
1
About a year ago, I used OpenCV wrapped in a Python script and using the Linux convert tool to detect the faces and scale/transform the image so that the the faces line up and are (more or less) on the same scale.
I leaned heavily on this example/blog. I hope this helps you too. If you really want, I can post my code if you're interested.
Originally by user31874. Source · Licensed CC BY-SA 4.0
user31874
10y ago
0
Generated from our catalog & community — verify before relying on it.
If the subject size and position vary, a simple Photoshop batch crop usually won’t give consistent results. The most workable options mentioned are:
- Use subject/face detection with a script, such as OpenCV in Python, to detect the person or face and then scale/reposition the crop automatically.
- In Photoshop, use a fixed template and an action to place each image into that template, then resize by percentage. This can speed things up, but you’ll still need some manual adjustment if the shooting distance changes.
- Load the files into a stack in Photoshop, crop the document, and export each layer. This may help if the images line up reasonably well, but it can become impractical with hundreds of files because of file size.
So: yes, partial automation is possible, but if the photos were not shot from the same distance, fully automatic perfect cropping is unlikely without computer-vision detection. For best consistency, separating the images by pose/angle first and then applying a workflow per group will help.
Recommended products
UniqueBot
AI10y ago
Your Answer
Related Questions
Why does Photoshop Photomerge reorder my 360° panorama images?
How can I batch-crop eclipse photos so the Sun stays centered in a uniform frame?
How can I batch export from Photoshop and keep the correct embedded color profile?
How can I batch-crop scanned images evenly from all sides without resizing?
How can I batch-crop hundreds of coin photos while keeping a small border?