Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

image-contrast

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-contrast - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

README.md

18

package.json
{
"name": "image-contrast",
"version": "0.0.1",
"version": "0.0.2",
"description": "Small library to apply a contrast transformation to a image",

@@ -9,4 +9,18 @@ "main": "index.js",

},
"author": "",
"author": "Ricardo Canastro",
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/canastro/image-contrast"
},
"bugs": {
"url": "https://github.com/canastro/image-contrast/issues"
},
"keywords": [
"image",
"image-contrast",
"contrast",
"transformation",
"pixel"
],
"devDependencies": {

@@ -13,0 +27,0 @@ "browserify": "^13.0.0"

35

sandbox/sandbox.js

@@ -18,19 +18,24 @@ var imageContrast = require('../index');

var context = canvas.getContext('2d');
var element = document.getElementById('from_data_original');
context.drawImage(element, 0, 0 );
var imageData = context.getImageData(0, 0, element.width, element.height);
var img = new Image;
img.onload = function(){
context.drawImage(img,0,0);
var result3 = imageContrast({
imageData: imageData,
to: '#target-3',
contrast: 30
});
console.log('result3: ', result3);
var imageData = context.getImageData(0, 0, img.width, img.height);
var result4 = imageContrast({
imageData: imageData,
to: '#target-4',
contrast: 70
});
console.log(result4);
var result3 = imageContrast({
imageData: imageData,
to: '#target-3',
contrast: 30
});
console.log('result3: ', result3);
var result4 = imageContrast({
imageData: imageData,
to: '#target-4',
contrast: 70
});
console.log(result4);
};
img.src = "http://lorempixel.com/400/200";
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc