
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@jimp/plugin-threshold
Advanced tools
@jimp/plugin-threshold is a plugin for the Jimp image processing library that allows you to apply threshold effects to images. This effect converts an image to black and white based on a threshold value, which can be useful for various image processing tasks such as edge detection, binarization, and more.
Apply Threshold Effect
This feature allows you to apply a threshold effect to an image. The `max` parameter specifies the threshold value. Pixels with a value above this threshold will be set to white, and those below will be set to black.
const Jimp = require('jimp');
Jimp.read('path/to/image.jpg')
.then(image => {
image.threshold({ max: 128 })
.write('path/to/output.jpg');
})
.catch(err => {
console.error(err);
});
Sharp is a high-performance image processing library that supports a wide range of image transformations, including thresholding. It is known for its speed and efficiency, especially with large images.
GraphicsMagick (gm) is a powerful image processing library that provides a wide range of image manipulation features, including thresholding. It is a wrapper around the GraphicsMagick command-line tool and is known for its robustness and versatility.
opencv4nodejs is a Node.js binding for OpenCV, a popular computer vision library. It provides extensive image processing capabilities, including thresholding, and is suitable for more advanced image analysis tasks.
Lightens an image.
This is useful as a simplified method for processing scanned drawings, signatures, etc
import jimp from "jimp";
async function main() {
const image = await jimp.read("test/image.png");
image.threshold({ max: 150 });
// or
image.threshold({ max: 200, replace: 200, autoGreyscale: false });
}
main();
FAQs
Unknown package
We found that @jimp/plugin-threshold demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.