Closed megetron closed 1 year ago
Did you see position
property of resize()
? The entropy
and attention
strategies can be used to "smartcrop" an image to the target dimensions.
https://sharp.pixelplumbing.com/api-resize#resize
sharp(input).resize({ width: 100, height: 100, position: 'attention' })...
Is there an option with sharp to crop image by the image content?
I have some images with white background and an object in the middle of the image. Looking for a way to remove the white padding that surrounding the image and then resize it.
This will help keep all objects on the same size which result a nice list layout. Can sharp do this? /