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.
magic-erase
Advanced tools
Clear blurry background in close-focused images, by selecting click-points on the image. Works like the magic-wand tool in Photoshopp.
npm install magic-erase
var magicErase = require('magic-erase')
// Tweak the Sensitivity for optimal result
var config = {
image: 'path-to-image', // JPG format and preferrably less than 100 kB
sensitivity: 50, // ranges from 0.1 to 100,
erasePoints: [
// a list of points on the image which will be used as the click points
// each point is <x-coordinate, y-coordinate>
// x-coordinate is from left to right
// y-coordinate is from top to bottom
// coordinates are normalized within the range 0 to 100 (i.e. percentage)
[45, 86], [87, 12], [9, 56]
]
}
var fs = require('fs')
var firstPass = magicErase(config).then(function (response) {
// save erased result as image file ...
var base64Img = response.base64Img
fs.writeFile('output-image.jpg', base64Img, { encoding: 'base64' }, function() {
console.log('Saved output image')
})
// use the erased result data for a second erase pass
var data = response.data
return data
})
var secondPass = firstPass.then(function(response) {
var newConfig = {
image: response,
sensitivity: 48,
erasePoints: [[8, 4], [65, 12]]
}
return magicErase(newConfig)
}).then(function(response) {
// just like in the first pass
var base64Img = response.base64Img
// use base64Img ...
return response.data
})
// .. do as many passes as you like ...
magic-erase-console is a simple web console for the magic-erase package.
Name | Image | AfterErasing | Sensitivity |
---|---|---|---|
Baseball | 12.2 | ||
Birb | 77.9 | ||
Cherry | 55 | ||
Mic | 14.9 | ||
Sunflower | 67.3 | ||
Flower | 0.1 |
FAQs
Clear blurry background in small close-focused images
The npm package magic-erase receives a total of 7 weekly downloads. As such, magic-erase popularity was classified as not popular.
We found that magic-erase 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.