trimByBorderColor

fun Bitmap.trimByBorderColor(@ColorInt color: Int = Color.TRANSPARENT, trimMargin: Margin? = null): Bitmap

Trims the borders of a bitmap of a specific color.

Return

A new bitmap with the borders trimmed.

Parameters

color

Color of the borders to be trimmed.

trimMargin

Optional margin in pixels to keep between the edges of the content and the bitmap borders.