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

palettext

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

palettext

Colors extract from image

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Palettext

Colors extract from image

Usage

Code

npm i palettext --save
const palettext = require('palettext');

let data = [/*...load 32 bit RGBA data...*/];
// i. e. CanvasRenderingContext2D.getImageData()
// i. e. Node.js Buffer (pngjs,...)
// i. e. Or simple array
let result = palettext(data, {qtyMax: 16});

Command line

npm i -g palettext
palettext --colors=16 in.png
palettext --colors=16 --format=json in.png >out.json

Options

  • qtyMax/--colors [default: 16] - maximum number of colors to search
  • fixed/--fixed [default: []] - fixed colors
  • colorspace/--colorspace [default: 'lab'] - working colorspace (rgb, xyz or lab)
  • threshold/--threshold [default: 0.2] - cutoff threshold for rare colors
  • stopIncQty/--stop [default: 3] - number of steps with an increasing value to stop
  • maxIterations/--steps [default: 100] - maximum number of steps
  • width/ - width of image

FAQs

Package last updated on 07 May 2020

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