Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
lens-core
Advanced tools
Readme
Small library that relies on webworkers to apply image transformations.
There are several modules that use lens-core
, check them on the filters folder on the lens repo.
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
import { getCanvas } from 'lens-core';
const canvas = getCanvas(100, 100);
Given a ImageData it returns the dataURL
import { convertImageDataToCanvasURL } from 'lens-core';
const canvasURL = 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.
import { applyFilters } from 'lens-core';
applyFilters({
data: 'image-data',
transform: transformationFunction,
options: {}, // options that are passed to the transformation function
nWorkers: 4 // number of webworkers to transform the image
}).then(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:
const transform = ({ data, length, options }) => {
for (let i = 0; i < length; i += 4) {
const r = data[i];
const g = data[i + 1];
const b = data[i + 2];
const v = (0.2126 * r + 0.7152 * g + 0.0722 * b >= options.level) ? 255 : 0;
data[i] = data[i + 1] = data[i + 2] = v;
}
return data;
};
FAQs
Core module for lens-filter
The npm package lens-core receives a total of 0 weekly downloads. As such, lens-core popularity was classified as not popular.
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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.