gm-to-grayscale

0.1.0 • Public • Published

gm-to-grayscale

Use gm to read an RGB buffer/image and make it grayscale.

Installation

npm install gm-to-grayscale

Usage

#!/usr/bin/env node
var gmToGrayscale = require('gm-to-grayscale');

gmToGrayscale('my-photo.png'), function (err, result) {
  if (err) {
    throw err;
  }

  console.log('Image size: ' + result.width + 'x' + result.height);

  fs.writeFile('my-photo.gray', result.image, function (err) {
    if (err) {
      throw err;
    }
  });
});

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i gm-to-grayscale

    Weekly Downloads

    1

    Version

    0.1.0

    License

    none

    Last publish

    Collaborators

    • mmalecki