Skip to main content

Filters and Image Processing | React Native Document Scanner

Apply Image Filter

ScanbotSDK.applyImageFilter(imageFileUri: string, filter: ImageFilter): Promise<string>

Applies filter to an image. As input, a file URI of the image must be passed. The output image will be a new file. The input image file will not be modified.

  • imageFileUri - file URI of the image to rotate
  • filter - ImageFilter string value

Returns

File URI to the rotated image file.

Image Filter values

Supported image filters:

  • COLOR_ENHANCED - Optimizes colors, contrast and brightness.
  • GRAYSCALE - Grayscale filter.
  • BINARIZED - Standard binarization filter with contrast optimization. Creates an 8-bit grayscale image with mostly black or white pixels.
  • COLOR_DOCUMENT - MagicColor filter. Fixes white balance and cleans up the background.
  • PURE_BINARIZED - A filter for binarizing an image. Creates an image with pixel values set to either pure black or pure white.
  • BACKGROUND_CLEAN - Cleans up the background and tries to preserve photos within the image.
  • BLACK_AND_WHITE - Black and white filter with background cleaning. Creates an 8-bit grayscale image with mostly black or white pixels.
  • OTSU_BINARIZATION - A filter for black and white conversion using OTSU binarization.
  • DEEP_BINARIZATION - A filter for black and white conversion primary used for low-contrast documents.
  • EDGE_HIGHLIGHT - A filter that enhances edges in low-contrast documents.
  • LOW_LIGHT_BINARIZATION - Binarization filter primarily intended for use on low-contrast documents with heavy shadows.
  • LOW_LIGHT_BINARIZATION_2 - Binarization filter primarily intended for use on low-contrast documents with heavy shadows.

Rotate Image

ScanbotSDK.rotateImage(imageFileUri: string, degrees: number): Promise<string>

Rotates an image by given degrees value. As input, a file URI of the image must be passed. The output image will be a new file. The input image file will not be modified.

Returns

Promise returning the file URI of the rotated result image.

Want to scan longer than one minute?

Generate your free "no-strings-attached" Trial License and properly test the Scanbot SDK.

Get your free Trial License

What do you think of this documentation?