From ecd01afad3633e957fa0a9294e3678ff957bde28 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Thu, 26 Mar 2020 20:22:47 +0000 Subject: [PATCH] Docs: clarify JPEG quality/chromaSubsampling interdependence --- docs/api-output.md | 2 +- lib/output.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-output.md b/docs/api-output.md index 41f801656..aee392ff0 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -143,7 +143,7 @@ Use these JPEG options for output image. - `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]** set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default `'4:2:0'`) + - `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.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`) diff --git a/lib/output.js b/lib/output.js index e03026eaa..4a8f252d1 100644 --- a/lib/output.js +++ b/lib/output.js @@ -183,7 +183,7 @@ function toFormat (format, options) { * @param {Object} [options] - output 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'] - set to '4:4:4' to prevent chroma subsampling when quality <= 90 + * @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.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