Skip to main content

Applying filters and rotating an image with the Web Document Scanner SDK

Overview​

You can enhance your scanned pages or raw images by applying a variety of filters and rotation adjustments. This improves their readability for humans and machines alike and streamlines further processing in your backend.

Example of rotating an image and applying filters​

Here's how you can perform various operations on an image and apply image filters.

const processor = await this.sdk.createImageProcessor();
let image = ... // your image data

image = await processor.crop(image, [{x: 0.1, y: 0.1}, {x: 0.9, y: 0.1}, {x: 0.9, y: 0.9}, {x: 0.1, y: 0.9}]);
image = await processor.rotate(image, "CLOCKWISE_90");
image = await processor.applyFilter(image, new ScanbotSDK.Config.ScanbotBinarizationFilter());

const jpegData = image.toJpeg();

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license