Skip to content

Commit

Permalink
Add interlaced option (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyraul authored and kevva committed Oct 4, 2019
1 parent 3916605 commit ef42c2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = options => async buffer => {
bitDepthReduction: true,
colorTypeReduction: true,
paletteReduction: true,
interlaced: false,
errorRecovery: true,
...options
};
Expand Down Expand Up @@ -39,6 +40,10 @@ module.exports = options => async buffer => {
arguments_.push('-nb');
}

if (options.interlaced) {
arguments_.push('-i', '1');
}

if (!options.colorTypeReduction) {
arguments_.push('-nc');
}
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ Default: `true`

Apply palette reduction.

##### interlaced

Type: `boolean`<br>
Default: `false`

Make images interlaced (progressive rendering). Interlaced images look better when they're loaded partially, but usually interlace makes compression less efficient.

##### errorRecovery

Type: `boolean`<br>
Expand Down

0 comments on commit ef42c2d

Please sign in to comment.