
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
resemble-image
Advanced tools
Provide color stops for a gradient that loosely resembles the original image.
Provide color stops for a gradient that loosely resembles the original image.
This package contains the algorithms getEqualWidthStops and getVariableWidthStops as described in Thoughts on Linear Gradients That Resemble Images.

npm install resemble-image --save-dev
import { getEqualWidthStops, getVariableWidthStops } from 'resemble-image';
var getEqualWidthStops = require('resemble-image').getEqualWidthStops;
var getVariableWidthStops = require('resemble-image').getVariableWidthStops;
Each function returns a promise, which resolves in an array of color–position pairs.
getEqualWidthStops(image, { fidelity: 4 }).then((stops) => console.log(stops));
// [ { color: '#023d33', position: 0 },
// { color: '#036357', position: 25 },
// { color: '#91aaa5', position: 50 },
// { color: '#cdcfd5', position: 75 } ]
getVariableWidthStops(image, { fidelity: 4 }).then((stops) => console.log(stops));
// [ { color: '#043630', position: 9.77 },
// { color: '#02554b', position: 33.79 },
// { color: '#c4c6dd', position: 67.97 },
// { color: '#c4c6dd', position: 95.31 } ]
FAQs
Provide color stops for a gradient that loosely resembles the original image.
The npm package resemble-image receives a total of 11 weekly downloads. As such, resemble-image popularity was classified as not popular.
We found that resemble-image demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.