
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
imagedata-filters
Advanced tools
imagedata-filters is a JavaScript library to operate canvas imagedata. It similar to css3 filter function.
Via npm
$ npm i imagedata-filters
Or download imagedata-filtes.min.js and include in your HTML
<img src="./example/atx.jpg" id="originImg">
<canvas id="filterImg" width="800" height="800">
<script src="./dist/imagedata-filters.min.js"></script>
<script>
var originImg = document.getElementById('originImg')
var filterImg = document.getElementById('filterImg')
var filterCtx = filterImg.getContext('2d')
filterCtx.drawImage(originImg, 0, 0)
var imageData = filterCtx.getImageData(0, 0, filterImg.width, filterImg.height), {amount: 1.2}
imagedataFilters.contrast(imageData, {amount: '1.2'}) // change imageData directly cause imageData.data is readonly
filterCtx.putImageData(imageData, 0, 0)
</script>
All the apis is similar to css3 filter function, the difference between css3 filter function and imagedata-filters function is that css3 function's argument is a css number value but imagedata-filters function's argument is an object which contains a key amount which is relevant to the css number value in css3 filter function.
options.amount is a value of radian, this is different from css3 hue-rorate.
use
blurcarefully, because Gaussiam blur compute may has a performance issue with the increase ofoptions.amount
MIT
通过npm安装
$ npm i imagedata-filters
或者直接下载imagedata-filtes.min.js并嵌入你的HTML页面中
<img src="./example/atx.jpg" id="originImg">
<canvas id="filterImg" width="800" height="800">
<script src="./dist/imagedata-filters.min.js"></script>
<script>
var originImg = document.getElementById('originImg')
var filterImg = document.getElementById('filterImg')
var filterCtx = filterImg.getContext('2d')
filterCtx.drawImage(originImg, 0, 0)
var imageData = filterCtx.getImageData(0, 0, filterImg.width, filterImg.height), {amount: 1.2}
imagedataFilters.contrast(imageData, {amount: '1.2'}) // 因为imageData.data是只读的,所以这里会直接修改imageData.data
filterCtx.putImageData(imageData, 0, 0)
</script>
所有的api都和css3 filter中的函数类似,不同的是,css3 fitler函数的参数是一个css数值, 而imagedata-filters函数中的options是一个对象,它有一个amount的key,对应着css3 filter里面的那个参数.
options.amount是一个弧度值,这一点与css3 hue-rorate不同。
使用
blur时注意,因为随着options.amount的增大,高斯模糊的计算可能会有性能问题.
MIT
FAQs
some filters for imagedata of canvas context2d
We found that imagedata-filters 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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.