How to change resolution and/or size of the image?
Sometimes images come with incorrect resolution. It's important to process images with correct resolution, because:
- Image OCR quality depends on the image physical size (and the physical size depends on its resolution)
- If the image resolution is incorrect, then the physical image size is also incorrect. The physical size might be enlarged for the incorrect resolution pages. 1 license counter unit is used to process 1 A4 page. If the mistaken image is as large as 2 A4 pages, then 2 license counter units will be used for the processing. This may use up all your license counters unexpectedly.
If the best resolution is known in advance, then it is possible to change it at the loading step:
PrepareImageMode.OverwriteResolution = true;
PrepareImageMode.yResolutionToOverwrite = Correct_Value;
PrepareImageMode.XResolutionToOverwrite = Correct_Value;
If the best resolution is unknown, then please use the following parameter instead:
PrepareImageMode.AutoOverwriteResolution = true
With these changes, the new resolution will be used for image preprocessing (i.e. for binarization, deskewing, etc.) unless you process a vector PDF.
Note: The solution above does not work for vector PDFs, only for the raster ones. For vector PDFs, please use the below method instead.
To change the resolution of an image that is already opened, use the ChangeResolution method of the ImageDocument object.
To detect the best resolution from the specified range and change the resolution of the page image accordingly, use the CorrectResolution method of the FRPage object. This suggestion is only relevant if the image resolution was not changed during the loading step.
To modify the image stretch ratio and the image size, please use the property of ImageModification.StretchRatio and call ModifyImage() method with this ImageModification.