diff --git a/docs/api-output.md b/docs/api-output.md index 4fc328a8..37185368 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -140,20 +140,22 @@ Returns **Sharp** Use these JPEG options for output image. +Some of these options require the use of a globally-installed libvips compiled with support for mozjpeg. + ### Parameters - `options` **[Object][6]?** output options - `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`) - `options.progressive` **[boolean][7]** use progressive (interlace) scan (optional, default `false`) - `options.chromaSubsampling` **[string][2]** for quality < 90, set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' (use chroma subsampling); for quality >= 90 chroma is never subsampled (optional, default `'4:2:0'`) + - `options.optimiseCoding` **[boolean][7]** optimise Huffman coding tables (optional, default `true`) + - `options.optimizeCoding` **[boolean][7]** alternative spelling of optimiseCoding (optional, default `true`) - `options.trellisQuantisation` **[boolean][7]** apply trellis quantisation, requires libvips compiled with support for mozjpeg (optional, default `false`) - `options.overshootDeringing` **[boolean][7]** apply overshoot deringing, requires libvips compiled with support for mozjpeg (optional, default `false`) - `options.optimiseScans` **[boolean][7]** optimise progressive scans, forces progressive, requires libvips compiled with support for mozjpeg (optional, default `false`) - - `options.optimizeScans` **[boolean][7]** alternative spelling of optimiseScans (optional, default `false`) - - `options.optimiseCoding` **[boolean][7]** optimise Huffman coding tables (optional, default `true`) - - `options.optimizeCoding` **[boolean][7]** alternative spelling of optimiseCoding (optional, default `true`) + - `options.optimizeScans` **[boolean][7]** alternative spelling of optimiseScans, requires libvips compiled with support for mozjpeg (optional, default `false`) - `options.quantisationTable` **[number][9]** quantization table to use, integer 0-8, requires libvips compiled with support for mozjpeg (optional, default `0`) - - `options.quantizationTable` **[number][9]** alternative spelling of quantisationTable (optional, default `0`) + - `options.quantizationTable` **[number][9]** alternative spelling of quantisationTable, requires libvips compiled with support for mozjpeg (optional, default `0`) - `options.force` **[boolean][7]** force JPEG output, otherwise attempt to use input format (optional, default `true`) ### Examples @@ -179,6 +181,8 @@ Use these PNG options for output image. PNG output is always full colour at 8 or 16 bits per pixel. Indexed PNG input at 1, 2 or 4 bits per pixel is converted to 8 bits per pixel. +Some of these options require the use of a globally-installed libvips compiled with support for libimagequant (GPL). + ### Parameters - `options` **[Object][6]?** diff --git a/lib/output.js b/lib/output.js index 550ae4b2..d8cdfff4 100644 --- a/lib/output.js +++ b/lib/output.js @@ -173,6 +173,8 @@ function toFormat (format, options) { /** * Use these JPEG options for output image. * + * Some of these options require the use of a globally-installed libvips compiled with support for mozjpeg. + * * @example * // Convert any input to very high quality JPEG output * const data = await sharp(input) @@ -186,14 +188,14 @@ function toFormat (format, options) { * @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'] - for quality < 90, set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' (use chroma subsampling); for quality >= 90 chroma is never subsampled + * @param {boolean} [options.optimiseCoding=true] - optimise Huffman coding tables + * @param {boolean} [options.optimizeCoding=true] - alternative spelling of optimiseCoding * @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 {boolean} [options.optimizeScans=false] - alternative spelling of optimiseScans, requires libvips compiled with support for 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 {number} [options.quantizationTable=0] - alternative spelling of quantisationTable, requires libvips compiled with support for mozjpeg * @param {boolean} [options.force=true] - force JPEG output, otherwise attempt to use input format * @returns {Sharp} * @throws {Error} Invalid options @@ -253,6 +255,8 @@ function jpeg (options) { * PNG output is always full colour at 8 or 16 bits per pixel. * Indexed PNG input at 1, 2 or 4 bits per pixel is converted to 8 bits per pixel. * + * Some of these options require the use of a globally-installed libvips compiled with support for libimagequant (GPL). + * * @example * // Convert any input to PNG output * const data = await sharp(input)