Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
image-filter-threshold
Advanced tools
Small library to apply a threshold transformation to a image relying on image-filter-core
handle the transformation and distribute work with webworkers.
Other related modules:
npm install image-filter-threshold --save
It applies a threshold 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.
This library consumes ImageData and outputs ImageData in a Promise. You can use image-filter-core
to convert from ImageData to dataURL.
JS file:
var imageThreshold = require('image-threshold');
imageThreshold({
data: IMAGE_DATA,
threshold: 30
});
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 imageFilterCore = require('image-filter-core');
imageThreshold({
data: IMAGE_DATA
}).then(function (result) {
// result === ImageData object
var image = document.createElement('img');
image.setAttribute('src', imageFilterCore.convertImageDataToCanvasURL(imageData));
target.appendChild(image);
});
FAQs
Small library to apply a threshold transformation to a image
The npm package image-filter-threshold receives a total of 21 weekly downloads. As such, image-filter-threshold popularity was classified as not popular.
We found that image-filter-threshold 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.