Skip to content

Commit

Permalink
Rename floyd option to dithering and drop the nofs option
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 7, 2019
1 parent 479a3e8 commit 515fb7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
14 changes: 4 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ module.exports = (options = {}) => input => {

const args = ['-'];

if (options.floyd && typeof options.floyd === 'number') {
args.push(`--floyd=${options.floyd}`);
}

if (options.floyd && typeof options.floyd === 'boolean') {
args.push('--floyd');
}

if (options.nofs) {
args.push('--nofs');
if (typeof options.dithering === 'number') {
args.push(`--floyd=${options.dithering}`);
} else if (options.dithering === false) {
args.push('--ordered');
}

if (options.posterize) {
Expand Down
13 changes: 5 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@ Returns a `Promise` for a `Buffer`.

#### options

##### floyd
Type: `Object`

##### dithering

Type: `number` `boolean`<br>
Default: `0.5`

Controls level of dithering (0 = none, 1 = full).

##### nofs

Type: `boolean`<br>
Default: `false`
Level of dithering (0 = none, 1 = full).

Disable Floyd-Steinberg dithering.
Pass in `false` to disable dithering.

##### posterize

Expand Down

0 comments on commit 515fb7e

Please sign in to comment.