Cropping followed by face detection generating off-center images
Hi,
I have recently started playing with Cloudinary, and I liked it. One of our requirements is to generate multiple versions for a given image. I am struggling with centering the face of a full body image.
I upload a 500x500px or larger image and I need a 300px face focused round version. I followed https://cloudinary.com/blog/face_detection_based_cropping and other documents but I can not seem to achieve the desired result. The face is never centered for large images. Here is an example: https://res.cloudinary.com/cloudninecare/image/upload/c_scale,q_100,w_500/c_crop,g_face:auto,h_300,q_100,r_max,w_300/v1556872837/dvpktmhpvts4qp8hvtnj.png
Please suggest me what can be done here.
Thanks for your time,
Nishant
-
Hi Nishant,
How does the following URL look:
https://res.cloudinary.com/cloudninecare/image/upload/c_fill,g_face:auto,q_100,r_max,w_300,h_300/z_1.8/v1556872837/dvpktmhpvts4qp8hvtnj.png
Let me know what you think :) -
Sorry for the delay. This seems to be working. I have added a scaling to 500 before the transformation because it may be super large portrait picture in that case assuming face would enclosed in a 300x300 box may not work. I have yet to test on multiple picture.
Thanks a lot for the help. You saved my day.
Nishant
Post is closed for comments.
Comments
2 comments