Trim
Trim
The trim operation shrinks the canvas size on a specified or all sides. You can think of it as removing a border.
To remove the same amount of pixels on all side, invoke with a single parameter.
image.trim(15)
image.trim(5, 40, 5, 19)
Examples
Using this image as our starting input:
image.trim(50) // will remove 50 pixels on all sides
image.trimLeft(100) // remove 100 pixels from the left side
image.trimBottom(200) // will remove 200 pixels from the bottom