Add AVIF/HEIF 'tune' option to control quality metrics #4227

This commit is contained in:
Lovell Fuller
2026-01-01 22:41:18 +00:00
parent 0d872bd13a
commit 006d37b2d0
10 changed files with 53 additions and 2 deletions

6
lib/index.d.ts vendored
View File

@@ -1167,6 +1167,8 @@ declare namespace sharp {
type HeifCompression = 'av1' | 'hevc';
type HeifTune = 'iq' | 'ssim' | 'psnr';
type Unit = 'inch' | 'cm';
interface WriteableMetadata {
@@ -1414,6 +1416,8 @@ declare namespace sharp {
chromaSubsampling?: string | undefined;
/** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
bitdepth?: 8 | 10 | 12 | undefined;
/** Tune output for a quality metric, one of 'iq', 'ssim' or 'psnr' (optional, default 'iq') */
tune?: HeifTune | undefined;
}
interface HeifOptions extends OutputOptions {
@@ -1429,6 +1433,8 @@ declare namespace sharp {
chromaSubsampling?: string | undefined;
/** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
bitdepth?: 8 | 10 | 12 | undefined;
/** Tune output for a quality metric, one of 'ssim', 'psnr' or 'iq' (optional, default 'ssim') */
tune?: HeifTune | undefined;
}
interface GifOptions extends OutputOptions, AnimationOptions {