For making Photo Collage Maker, I use fabric js which has an object-based clipping feature. This feature is great but the image inside that clipping region cannot be scaled,
This can be done much more easily. Fabric provides render method to clip by the context of another object.
Checkout this fiddle. I saw this on a comment here.
obj.clipTo = function(ctx) { ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); clippingRect.render(ctx); ctx.restore(); };