mirror of
https://github.com/danbulant/pngjs
synced 2026-07-08 12:40:35 +00:00
Remove filter type -1
This commit is contained in:
parent
99c5b43871
commit
75d2927e75
1 changed files with 3 additions and 7 deletions
10
README.md
10
README.md
|
|
@ -163,11 +163,9 @@ Returns `this` for method chaining.
|
||||||
|
|
||||||
For example, the following code copies the top-left 100x50 px of `in.png` into dst and writes it to `out.png`:
|
For example, the following code copies the top-left 100x50 px of `in.png` into dst and writes it to `out.png`:
|
||||||
```js
|
```js
|
||||||
var dst = new PNG({filterType: -1, width: 100, height: 50});
|
var dst = new PNG({width: 100, height: 50});
|
||||||
fs.createReadStream('in.png')
|
fs.createReadStream('in.png')
|
||||||
.pipe(new PNG({
|
.pipe(new PNG())
|
||||||
filterType: -1
|
|
||||||
}))
|
|
||||||
.on('parsed', function() {
|
.on('parsed', function() {
|
||||||
this.bitblt(dst, 0, 0, 100, 50, 0, 0);
|
this.bitblt(dst, 0, 0, 100, 50, 0, 0);
|
||||||
dst.pack().pipe(fs.createWriteStream('out.png'));
|
dst.pack().pipe(fs.createWriteStream('out.png'));
|
||||||
|
|
@ -183,9 +181,7 @@ The following example reads a file, adjusts the gamma (which sets the gamma to 0
|
||||||
|
|
||||||
```js
|
```js
|
||||||
fs.createReadStream('in.png')
|
fs.createReadStream('in.png')
|
||||||
.pipe(new PNG({
|
.pipe(new PNG())
|
||||||
filterType: -1
|
|
||||||
}))
|
|
||||||
.on('parsed', function() {
|
.on('parsed', function() {
|
||||||
this.adjustGamma();
|
this.adjustGamma();
|
||||||
this.pack().pipe(fs.createWriteStream('out.png'));
|
this.pack().pipe(fs.createWriteStream('out.png'));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue