Add margin option to trim operation #4480

This commit is contained in:
Dmytro Tiapukhin
2026-01-02 09:32:31 +00:00
committed by Lovell Fuller
parent d161e45e06
commit a5e726002c
15 changed files with 109 additions and 9 deletions

View File

@@ -599,7 +599,7 @@ const vertexSplitQuadraticBasisSpline: string = sharp.interpolators.vertexSplitQ
// Triming
sharp(input).trim({ background: '#000' }).toBuffer();
sharp(input).trim({ threshold: 10, lineArt: true }).toBuffer();
sharp(input).trim({ background: '#bf1942', threshold: 30 }).toBuffer();
sharp(input).trim({ background: '#bf1942', threshold: 30, margin: 20 }).toBuffer();
// Text input
sharp({