mirror of
https://github.com/lovell/sharp.git
synced 2026-02-04 05:36:18 +01:00
Add AVIF/HEIF 'tune' option to control quality metrics #4227
This commit is contained in:
@@ -181,4 +181,16 @@ describe('AVIF', () => {
|
||||
/Expected 8, 10 or 12 for bitdepth but received 11 of type number/
|
||||
)
|
||||
);
|
||||
|
||||
it('Different tune options result in different file sizes', async () => {
|
||||
const ssim = await sharp(inputJpg)
|
||||
.resize(32)
|
||||
.avif({ tune: 'ssim', effort: 0 })
|
||||
.toBuffer();
|
||||
const iq = await sharp(inputJpg)
|
||||
.resize(32)
|
||||
.avif({ tune: 'iq', effort: 0 })
|
||||
.toBuffer();
|
||||
assert(ssim.length < iq.length);
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user