Trim
Image trimming
Last updated
Image trimming
Last updated
Copyright © 2023 Scaleflex
Removes any single-color padding around the image if present.
The parameter does not specify the amount of border or frame to trim but rather how aggressive the trim algorithm should be. A bigger value of the parameter (e.g. 25) might trim part of the image. Typical values are between 0 and 10.
This allows you to use the same parameter values for all your images.
trim=X
If the image is resized with the width and/or height commands, the resizing is performed after the border (if present) is trimmed.
Preview | Syntax |
---|---|
Original image: /sample.li/painting_big.jpg?w=400 | |
Trimmed image: /sample.li/painting_big.jpg?w=400&trim=10 | |
Original image: /sample.li/sofa.jpg?w=400 | |
Trimmed image: /sample.li/sofa.jpg?w=400&trim=10 |