使用node.js和gm合并2个图像

时间:2013-01-22 15:32:35

标签: javascript node.js png graphicsmagick

我想使用node.js和节点的gm合并2个图像。事实上,我想在较大的图像上将一个较小的图像放在坐标x,y上。

我喜欢使用append()但是我不能选择将第二张图片放在第一张图片之上

这是我追加的js代码。

gm('img/vector/test.svg').append('img/base/test.png').write('img/final/test.png', function(err, stdout, stderr, command){
            if (err){
                console.log('image conversion error!'); 
                console.log(err); 
                console.log(command);    
            }else{ 
                console.log('image converted with command :'); 
                console.log(command);
            } 
        })

1 个答案:

答案 0 :(得分:1)

“此选项可创建单个图像,其中原始图像中的图像从上到下堆叠”表示gm doc

通常我会说看montage,但节点模块似乎不支持...