North Pittsburgh Meatpackers
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    luminancepublic

    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

    install

    npm i luminance

    Downloadslast 7 days

    6

    version

    1.0.3

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar