Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
lens-core
Advanced tools
Readme
Small library that relies on webworkers to apply image transformations.
There are several modules that use lens-core
, such as:
But you can easily create your own transformation function and rely on lens-core
to handle the webworkers and to split the work.
npm install lens-core --save
It returns a canvas with the given width and height
var lensCore = require('lens-core');
var canvas = lensCore.getCanvas(100, 100);
Given a ImageData it returns the dataURL
var lensCore = require('lens-core');
var canvasURL = lensCore.convertImageDataToCanvasURL(imageData);
Provide the ImageData, the transformation function, the options to be passed to the transformation function and the number of workers to split the work.
var lensCore = require('lens-core');
lensCore.apply(data, transform, options, nWorkers)
.then(function (imageData) {
// Do whatever you want with imageData
});
The transform function receives ImageData, the length of data to transform and the options that the developer provided to image-fiter-core, example transformation function for the threshold effect:
function transform (data, length, options) {
for (var i = 0; i < length; i += 4) {
var r = data[i];
var g = data[i + 1];
var b = data[i + 2];
var v = (0.2126 * r + 0.7152 * g + 0.0722 * b >= options.threshold) ? 255 : 0;
data[i] = data[i + 1] = data[i + 2] = v;
}
}
FAQs
Core module for lens-filter
We found that lens-core 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).