Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
image-brightness
Advanced tools
Small library to apply a brightness transformation to a image.
npm install image-brightness --save
It applies a brightness transformation to a base64 image. If you want a more complete library, please check image-filters that wraps this and other libraries to provide a more complete suite of image filters.
The default operation of this library is to consume imageData and return transformed imageData, but to facilitate a bit you can pass asDataURL
as true to return a dataURL that you can inject into a image tag.
var imageBrightness = require('image-brightness');
var result = imageBrightness({
data: IMAGE_DATA,
adjustment: 30,
asDataURL: true //if you want data to data transformation you don't need to include this
});
var element = document.getElementById('#dummy-image');
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
context.drawImage(element, 0, 0 );
var imageData = context.getImageData(0, 0, element.width, element.height);
var element = document.createElement('img');
element.setAttribute('src', options.url);
//...repeat process from the previous answer
var result = imageBrightness({
data: IMAGE_DATA,
adjustment: 30
});
var image = document.createElement('img');
image.setAttribute('src', result);
var target = document.getElementById('#dummy-target');
target.appendChild(image);
FAQs
Small library to apply a brightness transformation to a image
The npm package image-brightness receives a total of 2 weekly downloads. As such, image-brightness popularity was classified as not popular.
We found that image-brightness 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.