I'm looking for a script that detects a subject and crops the image.
I get thousands of RAW files with a wide framing. Same camera all over the shooting, same pixel dimensions. Models move and change pose.
I develop on C1 and export PSD files.
Work on the PSD files and export JPEG for the client.
Detect Model's height and crop leaving a few pixels above the head and bellow the feet.
Model should be centered on the image.
Keep aspect ratio 2:3.
Thanks in advance!
Thanks all for your help!
After reading all the proposals I came out with an action. Please take a look at it and let me know your comments.
The action runs auto-select, expands the selection 35px, creates a filled temp layer, transforms and uses the trim command.
To keep the 3:2 proportion I considered the model's height:
Width = 0.667 × Height
Once the model's height is "mapped" by the autoselect command I just copy the selection, rotate 90° and contract the width to 66.7%.
Then trim transparent pixels on top, bottom, left and right.
Just a little question :
I do not understand translations purpose (0,5/0,5 and then 0,5).
Hi didiermazier ,
I had to ad it in order to compensate for the "half pixels" produced by the round-up of the resulting number.
2:3 = 0.666`
The client is requesting a size of 2000x1333px and this fixed it quickly.
Thanks for the info.
Just adding 2 tips that do not enhance a lot your excellent solution but can help anyhow :
Anyway very interesting and inspiring thread, thanks!
Thanks for that!!
I optimized the action as adviced and updated to the link posted above.
didiermazier Photoshop actions sometimes seem to record this unnecessary 0.5 translation even when it is not explicitly called for. Go figure!
My version of the refined action is linked below as the one from maurom15189996 was not updated?
I removed the first tool selection step as it is not necessary (I also removed the 0.5px values).
Hi! I've come acrosss your action while looking for a solution to some what (or in my dream life fully) automate center cropping for portraits. This generally takes me an additoional 1-2 hours per school for school photos. I've loaded the action and tried it out, and it works fabulously as written. However for my needs I need it to be portrait, vs full body. I'm hoping for some guidance in adjusting the action, I'm still quite new at photoshop and can't figure how to change the shrunken person layers to acheive this.. Anyone want to spoil me and help?
I would suggest that you create a new topic, with a link back to this topic as a reference.
It would help if you could post 2-3 different images before/after to illustrate what you are trying to achieve.
As these are school portraits, please redact/pixelate etc. the faces for privacy, but don't affect the hair or other areas of the image that may be needed for select subject or other possible selection methods.
If these are high resolution, then perhaps make them half size, if they are resized too small then there may be too few pixels to accurately work with.
The solution from this topic is very similar to user expectations, so no need to create new topic. Of course let him say something more to see how close it is to that he wants. Probably the script / action must be extended of the part it cuts 2 / 3 of bottom part and additionally narrows the sides.
Rotating is a brillant idea!
hey mods, there are multiple spam bots in this thread...