New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ndarray-entropy

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

ndarray-entropy

Calculate the entropy of an intensity image, inspired by Matlab "entropy" function.

latest
Source
npmnpm
Version
0.5.0
Version published
Maintainers
1
Created
Source

ndarray-entropy

Calculate the entropy of an intensity image, inspired by Matlab "entropy" function.

Usage

Syntax

entropy(img [,options]);

Options

Optionrequireddefaultdescription
channelno0Select the RGB channel to calculate the entropy for. 0 for the red channel, 1 for the green and 2 for the blue one. If img is a 2D array, this option has no effect.

Example

const getPixels = require('get-pixels');
const entropy = require('ndarray-entropy');

getPixels('nature.png', (err, img) => {
  if (!err && img) {
    console.log(entropy(img));
    // > 7.140717410116984
  }
})

FAQs

Package last updated on 22 Oct 2019

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