# js-canvas-filters

> basic library for apply filters to canvas img

Latest version **1.0.0** (published 2017-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-canvas-filters
pnpm add js-canvas-filters
yarn add js-canvas-filters
bun add js-canvas-filters
```

## 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-12-10 |
| First published | 2017-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nicoandres.rodriguez@gmail.com |
| Maintainers | nicoandresr |
| Keywords | canvas, filters |

## Links

- npm: https://www.npmjs.com/package/js-canvas-filters
- Repository: https://github.com/nicoandresr/js-canvas-filters
- Homepage: https://github.com/nicoandresr/js-canvas-filters#readme
- Issues: https://github.com/nicoandresr/js-canvas-filters/issues
- npm.io page: https://npm.io/package/js-canvas-filters

## Dependencies (2)

- [babel-cli](https://npm.io/package/babel-cli.md) ^6.26.0
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.24.1

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-12-10

## README

# js-canvas-filters
This is a basic package for apply filters a canvas image

# Using
install from npm.
```js
npm i js-canvas-filters
```
import the filters
```js
import { thresholdFilter, greyScaleFilter } from 'js-canvas-filters';
```
And use the filters from a original canvas to a target canvas, into a [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) loop.
```js
const greyScaleImg = greyScaleFilter(originalCtx, constrast, brightness);
greyScaleCtx.putImageData(greyScaleImg, 0, 0);

const thresholdImg = thresholdFilter(originalCtx, threshold);
thresholdCtx.putImageData(thresholdImg, 0, 0);
```
# greyScaleFilter
Info about the filter using can be founded here https://en.wikipedia.org/wiki/Relative_luminance
# thresholdFilter
Info about the filter can be founded here https://en.wikipedia.org/wiki/Thresholding_(image_processing)

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