code: function streamPixmap(binaryPaths, pixmap, outputStream, settings, logger) {
          var outputCompleteDeferred = Q.defer();
  
          var args = _getConvertArguments(binaryPaths, pixmap, settings, logger);
  
          // Launch convert
          var convertProc = (_shouldUseFlite(settings, binaryPaths) ?
                             spawn(binaryPaths.flite, args) :
                             spawn(binaryPaths.convert, args));
  
          if (_shouldUseFlite(settings, binaryPaths)) {
              logger.log("Using Flite for image encoding" + (pixmap.iccProfile ? " with icc profile" : ""));
          }
  
          // Handle errors
          _rejectDeferredOnProcessIOError(convertProc, "convert", outputCompleteDeferred);
  
          // Capture STDERR
          var stderr = "";
          convertProc.stderr.on("data", function (chunk) {
              stderr += chunk;
          });
  
          // pngquant changes the process from `convert < pixmap > outputStream`
          // to `convert < pixmap | pngquant > outputStream`
          if (_shouldUsePNGQuant(settings)) {
              _pipeThroughPNGQuant(binaryPaths, convertProc.stdout, outputStream, outputCompleteDeferred);
          } else {
              // Pipe convert's output (the produced image) into the output stream
              convertProc.stdout.pipe(outputStream);
          }
  
          //send the iccProfile if present
          if (pixmap.iccProfile && _shouldUseFlite(settings, binaryPaths)) {
              convertProc.stdin.write(pixmap.iccProfile);
          }
          // Send the pixmap to convert
          convertProc.stdin.end(pixmap.pixels);
  
          // Wait until convert is done (pipe from the last utility will close the stream)
          outputStream.on("close", function () {
              if (stderr) {
                  outputCompleteDeferred.reject("ImageMagick error: " + stderr);
              } else {
                  outputCompleteDeferred.resolve();
              }
          });
  
          return outputCompleteDeferred.promise;
      }
docs: Exported functions