Use Uploadcare’s smart cropping to generate standardized user profile pictures automatically. Provide any size input image to produce a standardized picture by cropping irrelevant background areas.
The crop by objects transformation allows you to automatically crops the image to the object specified by the :tag
parameter. First, let’s find the face in this image:
First we need to upload the original image
https://ucarecdn.com/
d8ebbd7a-5790-4afc-86f1-60d8e2f60011/
-/crop/face/200px200p/
In the command above, we specified a percentage. That’s because we don’t want our image to be too tightly cropped on the face. So, we’ve requested an image that is 200% of the width and height of the detected face.
Next, we need to set the image to the right size. Using scale_crop, we scale the detected face to the right size and crop away anything that doesn’t fit into the dimensions we specify.
https://ucarecdn.com/
d8ebbd7a-5790-4afc-86f1-60d8e2f60011/
-/crop/face/200px200p/
-/scale_crop/550x550/center/