Basically, I have a transparent png image, and I want to fill the color inside the image, while preserving the outer transparency with fabricjs.
I tried using Tint and it works for the image below.

var canvas = this.__canvas = new fabric.Canvas('myCanvas'), f = fabric.Image.filters; fabric.Image.fromURL('imgpath/img.png', function (img) { var oImg = img.set({ left: 50, top: 100 }).scale(1); var tint = new fabric.Image.filters.Tint({ color: '#ff6c78', opacity: 1 }); oImg.filters.push(tint); oImg.applyFilters(canvas.renderAll.bind(canvas)); canvas.add(oImg).renderAll(); canvas.setActiveObject(oImg); });
Now I have an image that is transparent both inside and out. Is it possible to get a similar result for the image below?

- (a) Original image
- (b) Result using Tint
- (c) The result I'm really looking for
I'm not sure if this is possible with fabricjs. If not, what other javascript frameworks can be used?
Below are the source images.

Any help is appreciated. Thanks.
source share