refine Function

external fun refine(features: Iterable<RefineFeature>)

Processes this page in place, applying whichever of the features you pass.

This is the main processing step: it can crop the page to a document outline, straighten it, change its colour treatment, and rotate it, but it only does what the list asks for — a kind you leave out is left alone. It replaces the picture’s pixels, so keep a copy first if you need the original.

picture.refine(listOf(
    RefineFeature.Rectify.WithCutout(cutout),
    RefineFeature.Profile(RefineFeature.Profile.Type.Bitonal),
))

Parameters

  • features — what to apply, at most one of each RefineFeature kind

Throws

Top