Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
image-average-color
Advanced tools
A simple library that calculates the average color of a PNG, JPG or GIF image.
The only exported function takes two arguments: first is either Buffer with image contents or a filename, second one is a callback. Callback function should accept a possible error and a color in form of array of four values in range 0...255 representing red, green, blue and alpha channels.
const average = require('image-average-color');
average('image.png', (err, color) => {
if (err) throw err;
var [red, green, blue, alpha] = color;
});
loadImageFromAstral((err, data) => {
if (err) throw err;
average(data, (err, color) => {
if (err) throw err;
var [red, green, blue, alpha] = color;
});
});
This package also provides a command-line utility called average-color
that accepts
a filename and prints the average color in CSS format:
$ average-color image.jpg
rgba(86, 219, 101, 1)
FAQs
Get the average color of an image
The npm package image-average-color receives a total of 29 weekly downloads. As such, image-average-color popularity was classified as not popular.
We found that image-average-color 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.