npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

gm-to-grayscale

0.1.0

@mmalecki

npmSnykSocket
Downloads:5
$ npm install gm-to-grayscale
DailyWeeklyMonthlyYearly

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;
    }
  });
});