Skip to main content

Trim

Trim removes the same color pixels from the edges of the image. This is useful when you want to remove the white space around an image.

info

trim can be combined with all other options.

TransformationExamplesDescription
trim=tolerancetrim=20&resize=100,100 trim=10&resize=100,100request a trimmed image with tolerance

The transformation parameters are described below:-

ParameterDescription
tolerancecan be 0 to 10, where 0 compares edge pixel colors strictly and 10 treats them equal if they are close enough. A tolerance of 10 will trim even if they are small color gradient in surrounding pixels.