pub fn trim_transparency(pixmap: Pixmap) -> Option<(i32, i32, Pixmap)>
Expand description

Removes transparent borders from the image leaving only a tight bbox content.

Detects graphics element bbox on the raster images in absolute coordinates.

The current implementation is extremely simple and fairly slow. Ideally, we should calculate the absolute bbox based on the current transform and bbox. But because of anti-aliasing, float precision and especially stroking, this can be fairly complicated and error-prone. So for now we’re using this method.