- learning
- guides
- #automatic-profile-pictures
How to create automatic profile pictures?
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.
How to create user profile pictures automatically using smart cropping?
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
Let’s find the face in the 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/
Not everyone uses a face in their profile pictures. No problem.
Read more about how to use smart cropping with other objects→