Nodejs GraphicsMagick (gm) passing stream to .composite ()

Using Expressjs with the gm module (GraphicsMagick).

I would like to use the stream as input in .composite ().

Is this possible, or is there a way to do this?

I can combine using a path or a variable containing the path to the image, but I would like to pass in the stream instead (myStream).

Example:

var myStream = fs.createReadStream('topimage.png');

var resultStream = gm('/images/background.png')
                        .composite(myStream)
                        .gravity('Center')
                        .geometry('-1020+520')
                        .stream();
+4
source share

All Articles