You can crop an image based on any custom shape. Do this by having your own custom image as a mask for cropping, setting the overlay
parameter as your mask image's public ID and setting the flags
parameter to cutter
(in URLs: l_<mask_image>,fl_cutter
).
Here's the original image:
The following PNG image was uploaded to Cloudinary with the 'hexagon_sample' public ID:
Now, you can use this image with the cutter
flag. For example, when applying it to an image with the 'pasta' public ID:
You can also add the relative
flag to automatically adjust the dimensions of the mask to match the resulting image you need. For example:
The mask image can also be a semi-transparent PNG file to make the edges smoother. Here's an example of an uploaded mask:
And here's a sample result while creating a 200x220 face detection based thumbnail of an uploaded image: