You can use your own custom image as a mask for cropping by adding an overlay and using the 'cutter' transformation flag.
Using the API (in Ruby):
:overlay => "my_shape", :flags => "cutter".
For example, 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, applying on an image with the 'sample' 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 be a semi-transparent PNG file to make the edges more smooth.
Here's such an uploaded mask:
And here's a sample result while creating a 200x220 face detection based thumbnail of an uploaded images: