diff --git a/docs/api-output.md b/docs/api-output.md index 06335046..9c068d7b 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -115,13 +115,13 @@ Use these JPEG options for output image. - `options.quality` **[Number][8]** quality, integer 1-100 (optional, default `80`) - `options.progressive` **[Boolean][6]** use progressive (interlace) scan (optional, default `false`) - `options.chromaSubsampling` **[String][1]** set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default `'4:2:0'`) - - `options.trellisQuantisation` **[Boolean][6]** apply trellis quantisation, requires mozjpeg (optional, default `false`) - - `options.overshootDeringing` **[Boolean][6]** apply overshoot deringing, requires mozjpeg (optional, default `false`) - - `options.optimiseScans` **[Boolean][6]** optimise progressive scans, forces progressive, requires mozjpeg (optional, default `false`) + - `options.trellisQuantisation` **[Boolean][6]** apply trellis quantisation, requires libvips compiled with support for mozjpeg (optional, default `false`) + - `options.overshootDeringing` **[Boolean][6]** apply overshoot deringing, requires libvips compiled with support for mozjpeg (optional, default `false`) + - `options.optimiseScans` **[Boolean][6]** optimise progressive scans, forces progressive, requires libvips compiled with support for mozjpeg (optional, default `false`) - `options.optimizeScans` **[Boolean][6]** alternative spelling of optimiseScans (optional, default `false`) - `options.optimiseCoding` **[Boolean][6]** optimise Huffman coding tables (optional, default `true`) - `options.optimizeCoding` **[Boolean][6]** alternative spelling of optimiseCoding (optional, default `true`) - - `options.quantisationTable` **[Number][8]** quantization table to use, integer 0-8, requires mozjpeg (optional, default `0`) + - `options.quantisationTable` **[Number][8]** quantization table to use, integer 0-8, requires libvips compiled with support for mozjpeg (optional, default `0`) - `options.quantizationTable` **[Number][8]** alternative spelling of quantisationTable (optional, default `0`) - `options.force` **[Boolean][6]** force JPEG output, otherwise attempt to use input format (optional, default `true`) @@ -154,11 +154,11 @@ Indexed PNG input at 1, 2 or 4 bits per pixel is converted to 8 bits per pixel. - `options.progressive` **[Boolean][6]** use progressive (interlace) scan (optional, default `false`) - `options.compressionLevel` **[Number][8]** zlib compression level, 0-9 (optional, default `9`) - `options.adaptiveFiltering` **[Boolean][6]** use adaptive row filtering (optional, default `false`) - - `options.palette` **[Boolean][6]** quantise to a palette-based image with alpha transparency support, requires libimagequant (optional, default `false`) - - `options.quality` **[Number][8]** use the lowest number of colours needed to achieve given quality, requires libimagequant (optional, default `100`) - - `options.colours` **[Number][8]** maximum number of palette entries, requires libimagequant (optional, default `256`) - - `options.colors` **[Number][8]** alternative spelling of `options.colours`, requires libimagequant (optional, default `256`) - - `options.dither` **[Number][8]** level of Floyd-Steinberg error diffusion, requires libimagequant (optional, default `1.0`) + - `options.palette` **[Boolean][6]** quantise to a palette-based image with alpha transparency support, requires libvips compiled with support for libimagequant (optional, default `false`) + - `options.quality` **[Number][8]** use the lowest number of colours needed to achieve given quality, requires libvips compiled with support for libimagequant (optional, default `100`) + - `options.colours` **[Number][8]** maximum number of palette entries, requires libvips compiled with support for libimagequant (optional, default `256`) + - `options.colors` **[Number][8]** alternative spelling of `options.colours`, requires libvips compiled with support for libimagequant (optional, default `256`) + - `options.dither` **[Number][8]** level of Floyd-Steinberg error diffusion, requires libvips compiled with support for libimagequant (optional, default `1.0`) - `options.force` **[Boolean][6]** force PNG output, otherwise attempt to use input format (optional, default `true`) ### Examples diff --git a/lib/output.js b/lib/output.js index 3fff4a9b..985cc95b 100644 --- a/lib/output.js +++ b/lib/output.js @@ -144,13 +144,13 @@ function withMetadata (withMetadata) { * @param {Number} [options.quality=80] - quality, integer 1-100 * @param {Boolean} [options.progressive=false] - use progressive (interlace) scan * @param {String} [options.chromaSubsampling='4:2:0'] - set to '4:4:4' to prevent chroma subsampling when quality <= 90 - * @param {Boolean} [options.trellisQuantisation=false] - apply trellis quantisation, requires mozjpeg - * @param {Boolean} [options.overshootDeringing=false] - apply overshoot deringing, requires mozjpeg - * @param {Boolean} [options.optimiseScans=false] - optimise progressive scans, forces progressive, requires mozjpeg + * @param {Boolean} [options.trellisQuantisation=false] - apply trellis quantisation, requires libvips compiled with support for mozjpeg + * @param {Boolean} [options.overshootDeringing=false] - apply overshoot deringing, requires libvips compiled with support for mozjpeg + * @param {Boolean} [options.optimiseScans=false] - optimise progressive scans, forces progressive, requires libvips compiled with support for mozjpeg * @param {Boolean} [options.optimizeScans=false] - alternative spelling of optimiseScans * @param {Boolean} [options.optimiseCoding=true] - optimise Huffman coding tables * @param {Boolean} [options.optimizeCoding=true] - alternative spelling of optimiseCoding - * @param {Number} [options.quantisationTable=0] - quantization table to use, integer 0-8, requires mozjpeg + * @param {Number} [options.quantisationTable=0] - quantization table to use, integer 0-8, requires libvips compiled with support for mozjpeg * @param {Number} [options.quantizationTable=0] - alternative spelling of quantisationTable * @param {Boolean} [options.force=true] - force JPEG output, otherwise attempt to use input format * @returns {Sharp} @@ -221,11 +221,11 @@ function jpeg (options) { * @param {Boolean} [options.progressive=false] - use progressive (interlace) scan * @param {Number} [options.compressionLevel=9] - zlib compression level, 0-9 * @param {Boolean} [options.adaptiveFiltering=false] - use adaptive row filtering - * @param {Boolean} [options.palette=false] - quantise to a palette-based image with alpha transparency support, requires libimagequant - * @param {Number} [options.quality=100] - use the lowest number of colours needed to achieve given quality, requires libimagequant - * @param {Number} [options.colours=256] - maximum number of palette entries, requires libimagequant - * @param {Number} [options.colors=256] - alternative spelling of `options.colours`, requires libimagequant - * @param {Number} [options.dither=1.0] - level of Floyd-Steinberg error diffusion, requires libimagequant + * @param {Boolean} [options.palette=false] - quantise to a palette-based image with alpha transparency support, requires libvips compiled with support for libimagequant + * @param {Number} [options.quality=100] - use the lowest number of colours needed to achieve given quality, requires libvips compiled with support for libimagequant + * @param {Number} [options.colours=256] - maximum number of palette entries, requires libvips compiled with support for libimagequant + * @param {Number} [options.colors=256] - alternative spelling of `options.colours`, requires libvips compiled with support for libimagequant + * @param {Number} [options.dither=1.0] - level of Floyd-Steinberg error diffusion, requires libvips compiled with support for libimagequant * @param {Boolean} [options.force=true] - force PNG output, otherwise attempt to use input format * @returns {Sharp} * @throws {Error} Invalid options