pica 7.1.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -75,12 +75,8 @@ Use
75
75
  const pica = require('pica')();
76
76
 
77
77
  // Resize from Canvas/Image to another Canvas
78
- pica.resize(from, to, {
79
- unsharpAmount: 160,
80
- unsharpRadius: 0.6,
81
- unsharpThreshold: 1
82
- })
83
- .then(result => console.log('resize done!'));
78
+ pica.resize(from, to)
79
+ .then(result => console.log('resize done!'));
84
80
 
85
81
  // Resize & convert to blob
86
82
  pica.resize(from, to)
@@ -100,7 +96,8 @@ Create resizer instance with given config (optional):
100
96
  to restrict peak memory use. Default 1024.
101
97
  - __features__ - list of features to use. Default is
102
98
  `[ 'js', 'wasm', 'ww' ]`. Can be `[ 'js', 'wasm', 'cib', 'ww' ]`
103
- or `[ 'all' ]`.
99
+ or `[ 'all' ]`. Note, `cib` is buggy in Chrome and not supports default
100
+ `mks2013` filter.
104
101
  - __idle__ - cache timeout, ms. Webworkers create is not fast.
105
102
  This option allow reuse webworkers effectively. Default 2000.
106
103
  - __concurrency__ - max webworkers pool size. Default is autodetected
@@ -131,10 +128,11 @@ taken from source and destination objects.
131
128
  - __from__ - source, can be `Canvas`, `Image` or `ImageBitmap`.
132
129
  - __to__ - destination canvas, its size is supposed to be non-zero.
133
130
  - __options__ - quality (number) or object:
134
- - __quality__ - 0..3. Default = `3` (lanczos, win=3).
135
- - __alpha__ - use alpha channel. Default = `false`.
136
- - __unsharpAmount__ - >=0, in percents. Default = `0` (off). Usually
137
- between 100 to 200 is good.
131
+ - __quality__ (deprecated, use `.filter` instead) - 0..3.
132
+ - __filter__ - filter name (Default - `mks2013`). See [resize_filter_info.js](https://github.com/nodeca/pica/blob/master/lib/mm_resize/resize_filter_info.js) for details. `mks2013` does both resize and sharpening, it's optimal and not recommended to change.
133
+ - __unsharpAmount__ - >=0. Default = `0` (off). Usually
134
+ value between 100 to 200 is good. Note, `mks2013` filter already does
135
+ optimal sharpening.
138
136
  - __unsharpRadius__ - 0.5..2.0. By default it's not set. Radius of Gaussian
139
137
  blur. If it is less than 0.5, Unsharp Mask is off. Big values are clamped
140
138
  to 2.0.
@@ -170,10 +168,11 @@ binary data (for example, if you decode jpeg files "manually").
170
168
  - __height__ - src image height.
171
169
  - __toWidth__ - output width, >=0, in pixels.
172
170
  - __toHeight__ - output height, >=0, in pixels.
173
- - __quality__ - 0..3. Default = `3` (lanczos, win=3).
174
- - __alpha__ - use alpha channel. Default = `false`.
175
- - __unsharpAmount__ - >=0, in percents. Default = `0` (off).
176
- Usually between 50 to 100 is good.
171
+ - __quality__ (deprecated, use `.filter` instead) - 0..3.
172
+ - __filter__ - filter name (Default - `mks2013`). See [resize_filter_info.js](https://github.com/nodeca/pica/blob/master/lib/mm_resize/resize_filter_info.js) for details. `mks2013` does both resize and sharpening, it's optimal and not recommended to change.
173
+ - __unsharpAmount__ - >=0. Default = `0` (off). Usually
174
+ value between 100 to 200 is good. Note, `mks2013` filter already does
175
+ optimal sharpening.
177
176
  - __unsharpRadius__ - 0.5..2.0. Radius of Gaussian blur.
178
177
  If it is less than 0.5, Unsharp Mask is off. Big values are
179
178
  clamped to 2.0.