title: Remove image background in node
body: <p>I am working on the project where I am capturing user's face from  and putting it on the existing model. 
  To combine face and model image I am using gm library from node; and for face detection I am using opencv. I am able to do both detect face and put it on the model. 
  But the issue is my model is having transparent background but user's face not (because face is captured from camera).</p>
  
  <p>I want to remove the background of face and make it transparent. Is there any way to make this possible?</p>
  
  <p>Here is my code for integration:</p>
  
  <pre><code>gm()
              .in('-page', '+0+0')
              .in("public/" + modelImagePath) 
              .in('-page', '+130+45')  
              .in(newDir + '/crp.png')
              .mosaic()
              .write(resultantImage, function (err) {
                 if (err) console.log(err);
  
              });
  </code></pre>
  
  <p>Here crp.png is face image and modelimagepath is model image
  Complete opencv + gm code:</p>
  
  <pre><code>cv.readImage(newDir + "/zxcv.png", function(err, im){
        im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){
          console.log("into detec:" + faces.length + "," + faces[0]);
  
          if ( faces.length &gt; 0)
          {
              var x = faces[0];
              gm(newDir + "/zxcv.png")
              .crop(x.width,x.height,x.x,x.y)
              .write(newDir + '/crp.png', function (err) {
                  if (err) console.log(err);
               });
  
              var modelImagePath = getModelBasedOnSize(hips, skin, waist, weight, 1);
              var modelSize = modelImagePath.split("-")[1].split(".")[0];
              resultantImage = newDir + "/result-" + modelSize + ".png";
              gm()
              .in('-page', '+0+0')
              .in("public/" + modelImagePath) 
              .in('-page', '+130+45') // frok -&gt; 95 87 //+105+60 // 
              .in(newDir + '/crp.png')
              .mosaic()
              .write(resultantImage, function (err) {
                 if (err) console.log(err);
                 res.end(resultantImage.replace('public/', ''));
                 //res.end(resultImage.replace('public/', ''));
              });
          }
          else{
              console.log("into else - pic not present");
              var modelImagePath = getModelBasedOnSize(hips, skin, waist, weight, 0);
              res.end(modelImagePath.replace('public/', ''));
          }
        }); //opencv detect face
      })
  </code></pre>