0.1.1 • Published 8 years ago

image-luminosity v0.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

image-luminosity

Install

$ npm i --save image-luminosity

Usage

var imgLum = require('image-luminosity');
var image = '/directory/to/img';

imgLum(image, function(value) {
        console.log(value);
    }, {sx: 120,
        sy: 120,
        sWidth: 300,
        sHeight: 300
    });

Syntax

imgLum(image, callback, [{sx, sy, sWidth, sHeight}]);

Parameters

image: Directory to image being analyzed. callback: Needed because of async nature of image analysis.

Dimensions

Leave blank if whole image is being analyzed sx: Starting X position. sy: Startng Y position. sWidth: Width of desired area to be analyzed. sHeight: Height of desired area to be analyzed.

Return Values

value.brightness: Brightness level of image. value.opacity: Opacity level of image. value.r: Brightness of red levels in the image. value.g: Brightness of green levels in the image. value.b: Brightness of blue levels in the image.