Comparing version 1.1.1 to 1.1.2
@@ -16,2 +16,5 @@ History | ||
#### 1.1.2 _(2015-08-10)_ | ||
- Remove some unused files | ||
#### 1.1.1 _(2015-02-04)_ | ||
@@ -18,0 +21,0 @@ - Adds the slightly faster but less accurate Manhatten color distance as option |
@@ -6,3 +6,3 @@ { | ||
"author": "Leon Sorokin <leeoniya@gmail.com>", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"main": "src/rgbquant.js", | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -58,3 +58,31 @@ RgbQuant.js | ||
``` | ||
### Node.js | ||
npm package: https://www.npmjs.com/package/rgbquant | ||
example with https://www.npmjs.com/package/canvas | ||
```js | ||
var fs = require('fs'), | ||
Canvas = require('canvas'), | ||
Image = Canvas.Image, | ||
RgbQuant = require('rgbquant'); | ||
var imgPath = "./test.png", | ||
img, can, ctx, q, pal, out; | ||
fs.readFile(imgPath, function(err, data) { | ||
img = new Image; | ||
img.src = data; | ||
can = new Canvas(img.width, img.height); | ||
ctx = can.getContext('2d'); | ||
ctx.drawImage(img, 0, 0, img.width, img.height); | ||
q = new RgbQuant(); | ||
q.sample(can); | ||
pal = q.palette(true); | ||
out = q.reduce(can); | ||
}); | ||
``` | ||
--- | ||
@@ -61,0 +89,0 @@ ### Docs |
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
8943956
4518
150
0
137