Skip to main content
Version: v8001

Extract document images

BlinkID can return images alongside extraction results. This is useful when you need to pass the captured document images to a downstream service—such as the BlinkID Verify API—or store them for audit purposes.

Types of images​

BlinkID can return two distinct types of images:

  • Input images (raw camera frames): the original, unprocessed frames captured by the camera, including the background around the document.
  • Document images (cropped): perspective-corrected images tightly framed on the document itself.

If you are passing images to Verify, use raw input images.

Enable image return​

Set inputImageReturnEnabled: true inside documentCaptureModule:

const settings: ScanningSettings = {
documentCaptureModule: {
inputImageReturnEnabled: true,
},
};

To also receive cropped document or face images, set the corresponding flags in documentCaptureModule:

const settings: ScanningSettings = {
documentCaptureModule: {
inputImageReturnEnabled: true,
documentImageReturnEnabled: true,
faceImageExtractionEnabled: true,
},
};

Access images on the result​

The result contains inputImageFront, inputImageBack, and inputImageBarcode fields with the raw ImageData frames.

Encode to PNG before sending to an API:

const canvas = document.createElement("canvas");
canvas.width = result.inputImageFront.width;
canvas.height = result.inputImageFront.height;
canvas.getContext("2d")!.putImageData(result.inputImageFront, 0, 0);
const base64 = canvas.toDataURL("image/png").split(",")[1];

Use lossless compression​

Do not use lossy compression (such as JPEG) on images you intend to pass to a verification backend. Lossy compression degrades image quality in ways that can affect analysis. Encode to PNG instead, as shown in the examples above.

Do not post-process images​

Pass the images as-is from the SDK result. Do not crop, resize, rotate, or otherwise modify them after capture. Post-processing can break assumptions that downstream services make about image integrity.