Imgix APIsRendering APITrimTrim Image

Trim Image

trim

Trims the image to remove a uniform border around the image. This operation must be set for the other trim parameters to work, and it will change the size of the image.

The four available values are:

  • auto: Trims the image automatically based on the border color. You can adjust the tolerance using trim-md and trim-sd.
  • color: Checks for alpha transparency and trims that if it exists. It then trims the color specified by trim-color, as long as it is within the trim-tol threshold.
  • alpha: Trims away the transparency specified by trim-alpha, as long as it is within the trim-tol threshold.
  • colorunlesalpha: Checks if an alpha channel exists. If alpha exists, it trims the transparency and exits the trimming operation. If no alpha exists, it trims the color as specified by trim-color.