Automaticaly crop a picture
Hello Team,
Hope you are doing good.
I need to know which parameters should I add to automatically crop pictures, example :
original pic 1 : https://www.chanel.com/images/f_jpg/-9518357119006.jpg
original pic 2 : https://www.chanel.com/images/f_jpg/-9518010859550.jpg
The expected result is :
pic 1 : https://www.chanel.com/images/w_0.51,h_0.51,c_crop/f_jpg/-9518357119006.jpg
pic 2 : https://www.chanel.com/images/w_0.75,h_0.75,c_crop/f_jpg/-9518010859550.jpg
Thank you.
Best Regards,
-
Hi Badre,
Good day! Thanks for reaching out.
Take a look at these transformations. Hopefully, these are what you need.
https://www.chanel.com/images/e_trim/$nwidth_w/c_lpad,w_$nwidth,h_$nwidth/b_rgb:F7F7F7,e_brightness:-3/c_mpad,w_$nwidth_mul_1.2,h_$nwidth_mul_1.2/f_auto,q_auto/-9518010859550.jpg
https://www.chanel.com/images/e_trim/$nwidth_w/c_lpad,w_$nwidth,h_$nwidth/b_rgb:F7F7F7,e_brightness:-3/c_mpad,w_$nwidth_mul_1.2,h_$nwidth_mul_1.2/f_auto,q_auto/bo-9518357119006.jpgThe base transformation uses the `e_trim` effect. This will remove the background retaining the focal object. The next set of transformations will now use the new trimmed dimensions stored inside $nwidth_w to add back background and padding to achieve the cropping desired.
You can adjust the value `w_$nwidth_mul_1.2,h_$nwidth_mul_1.2` to further add padding on the width and height.
Here is the documentation for the user-defined variables and arithmetic operations. Here is the reference for the transformations used.
Let me know if this helps.
Best Regards,
John0
Post is closed for comments.
Comments
1 comment