Implementing Fabric.js in HTML page

Hello all,

I want to use fabric.js and apply the pattern on image.

Suppose I have an image of chair and I want to change the fabric of chair's seat and back. If you say that use another image to apply fabric then I don't require that.

On click to fabric image, that fabric should be applied to the chair's back and seat.

How we can achieve with fabric.js.

Help me, I am stuck onto this from 1 week

Thanks in advance