D
D
Doctor Bi2019-02-19 15:48:01
JavaScript
Doctor Bi, 2019-02-19 15:48:01

How to save image without overlay in fabric js?

Good afternoon
There is an svg image in a certain form, which is set as overlay in fabric js

fabric.loadSVGFromURL(
            url,
            (objects, options) => {
                const background = fabric.util.groupSVGElements(objects, options);
                background.scaleToWidth(canvas.getWidth());
                canvas.setOverlayImage(background).renderAll()
            },
            null,
            {crossOrigin: 'anonymous'},
        );

And there is the main image that I position in the fabric js canvas
It looks like this:
5c6beac9631e0577134394.jpeg
After I need to save the image obtained behind the overlay (aunt in this case) without a black border
If I delete the overlay, then the "aunt" will be wider than necessary
Is it possible to save the image without overlay ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question