New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graycolorize

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graycolorize

replace grayscale with color from a colormap

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by20%
Maintainers
1
Weekly downloads
 
Created
Source

graycolorize

Replace grayscale with color from a colormap

Build Status

Usage:

var graycolorize = require('graycolorize');

graycolorize(pixels, colormap);

where pixels is an ndarray of pixels (e.g., loaded by get-pixels). colormap is a 256x4 ndarray of RGBA colors for each 256 grayscale colors to replace.

You can create the colormap yourself or call graycolorize.generateMap(hue, saturation) to generate one for you, with the given hue and saturation (0-1) from minimum to maximum brightness:

var colormap = graycolorize.generateMap(0.25, 0.5);

Example (see demo.js or run npm start):

screenshot

License

MIT

Keywords

FAQs

Package last updated on 09 May 2016

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