I have a Rails app where users can upload images. After they upload an image, I need to apply a mask on that image, so parts of it become transparant. Is this possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
RMagick (a Ruby image manipulation library) allows you to apply clipping path on objects : http://www.imagemagick.org/RMagick/doc/rvgclip.html
Basically, you’ll need to :
A click on the keyhole image” there pops up an example of how to achieve this :
EDIT :
If you need to apply a transparent background the simplest approach should be to crop your image, then use the
Image#composite!method to add a trnasparent layer.