Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-canvas-filters

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-canvas-filters

basic library for apply filters to canvas img

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

js-canvas-filters

This is a basic package for apply filters a canvas image

Using

install from npm.

npm i js-canvas-filters

import the filters

import { thresholdFilter, greyScaleFilter } from 'js-canvas-filters';

And use the filters from a original canvas to a target canvas, into a requestAnimationFrame loop.

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)

Keywords

FAQs

Package last updated on 10 Dec 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc