# levels-to-table

> A module for converting image level values to an array of output values

Latest version **1.0.0** (published 2017-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install levels-to-table
pnpm add levels-to-table
yarn add levels-to-table
bun add levels-to-table
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-01-22 |
| First published | 2017-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Hernan Torrisi |
| Maintainers | airnan |

## Links

- npm: https://www.npmjs.com/package/levels-to-table
- Repository: https://github.com/bodymovin/levels-to-table
- Homepage: https://github.com/bodymovin/levels-to-table#readme
- Issues: https://github.com/bodymovin/levels-to-table/issues
- npm.io page: https://npm.io/package/levels-to-table

## Recent versions

- 1.0.0 (latest) — 2017-01-22

## README

# levels-to-table
A module for converting image level values to an array of output values  

usage:

`var histogram = require('histogram');
var table = levelsToTable(inputBlack, inputWhite, gamma, outputBlack, outputWhite);`

where inputBlack, inputWhite, outputBlack, outputWhite values go from 0 to 255, although it supports any range and even negative values.  
Gamma is an exponential value, so set it to 1 for a linear transformation.  
The function for each value is expressed like so:  
*R' = outputBlack + (outputWhite - outputBlack)  Math.pow((R - inputBlack) / (inputWhite - inputBlack), 1 / gamma)*

---
_Source: https://npm.io/package/levels-to-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
