Overview
Sources
Libraries
Images API

Trim trim

Specify the trim mode used to remove non-edge color areas from the image.

Values

Accepted values for this parameter are auto and color.

This parameter is affected by the level or intensity of the trim process, specified by trim-level parameter.

Auto trim=auto

Will trim the image based on the top left pixel color.

We will use the following source image to apply trim parameter:

GET
https://assets.imglab-cdn.net/woman-04.jpeg
Woman on black background.
x px

In the following example we are using trim=auto. The top left pixel color will be taken as reference and trimmed from the image:

GET
https://assets.imglab-cdn.net/woman-04.jpeg?trim=auto
Woman on black background with trim auto applied.
x px

Color trim=color

Will trim the image based on the color specified by trim-color parameter.

We will use the following source image to apply trim=color parameter:

GET
https://assets.imglab-cdn.net/orange.jpeg
Half peeled orange.
x px

In the following example we will use trim=color and trim-color=orange parameters to remove orange areas surrounding the image:

GET
https://assets.imglab-cdn.net/orange.jpeg?trim=color&trim-color=orange
Half peeled orange with orange background color trimmed using trim-color parameter.
x px