is it possible to remove the transparent part of an image using CANVAS and Javascript?

Hi so for example this image https://e7.pngegg.com/pngimages/433/468/png-clipart-white-heart-shape-illustration-heart-outline-wedding-hearts-love-angle.png

Is it possible to remove the transparent part of the image using CANVAS and JS? And by removing I mean the it’ll cut or crop image so the transparent part will be removed to the image? I haven’t a sample code to share, I tried to look it online, but I really got any answers from the search results I made.