Socket
Book a DemoInstallSign in
Socket

luminance

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

luminance

Convert RGB to grayscale

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

luminance

Converts an RGB image into a grayscale luminance image. This is built on the ndarray library.

Example

//Load up a test image
var lena = require("lena")

//Convert to grayscale
var grayscale_lena = require("luminance")(lena)

//Write the resulting png to stdout
require("save-pixels")(grayscale_lena, "png").pipe(process.stdout)

Which creates the following image:

Install

npm install luminance

API

var luminance = require("luminance")

luminance(img)

Returns A gray scale version of img

luminance(result, img)

Returns A gray scale version of img, the result is stored in result

luminance(red, green, blue)

Returns A gray scale image with red, green and blue channels in the given ndarrays

luminance(result, red, green, blue)

Returns A luminance image of red/green/blue with result stored in result.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

luminance

FAQs

Package last updated on 29 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts