Cropping an image with a script is not a big deal as there are many libraries available in every language, but some could lead to the following case :
A few web searches about “failsafe crop” led us to a very interesting paper : A Uniﬁed Approach to Salient Object Detection via Low Rank Matrix Recovery
Unfortunately, it involves multiple steps and a lot of computing (~ 3 to 6 seconds per image).
cropy is in early stage and has some issue but gives some good results if the crop width or height is not far from the original image.
Here are some sample crops with different ratio, based on the previous image.
Original image (800×600)
pip install cropy
The whole project is open source and hosted on Github. We’d love to hear from you if you’d like to contribute!
Some other useful links :