Browse our Products

Aspose.OCR for Python via .NET 24.10.0 - Release Notes

Deprecation warning

What was changed

KeySummaryCategory
OCRPY‑74Added the ability to reduce PDF file size at the expense of lower background image quality.New feature
OCRPY‑74Introduced simple and straightforward content structure detection modes.Enhancement

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Python via .NET 24.10.0 that may affect the code of existing applications.

Added public APIs:

The following public APIs have been added to Aspose.OCR for Python via .NET 24.9.0 release:

PdfOptimizationMode enumeration

The optimization mode specifies the balance between file size and image quality of saved PDFs.

NameDescription
NONEDo not optimize PDF size.
MAXIMUM_QUALITYOptimize file size while preserving the highest image quality.
HIGH_QUALITYSmaller PDF file size at the expense of sight image downsampling.
BALANCEDDownsample images to balance file size and image quality.
AGGRESSIVESignificantly reduce the PDF file size at the expense of lower image quality.

Updated public APIs:

The following public APIs have been introduced in Aspose.OCR for Python via .NET 24.10.0 release:

DetectAreasMode enumeration values

A scan or photograph of a text may contain a large number of blocks of various content - text paragraphs, tables, illustrations, formulas, and the like. Detecting, ordering, and classifying areas of interest on a page is the cornerstone of successful and accurate OCR.

Aspose.OCR for .NET 24.10.0 introduces new simple and straightforward content structure detection modes:

NameDescriptionUse cases
DetectAreasMode.UNIVERSALDetects all blocks of text in the image, including sparse and irregular text on street photos. Default content recognition mode.A versatile option for most images, except for tables and multi-column layouts.
DetectAreasMode.MULTICOLUMNDetects large blocks of text formatted in columns.Multi-column layouts such as book pages, articles, or contracts.
DetectAreasMode.LEANPrioritizes speed and reduces resource consumption by omitting support for complex layouts.Simple images with a few lines of text without illustrations or formatting.

Removed public APIs:

No changes.

Deprecated APIs

The following public APIs have been marked as deprecated and will be removed in 25.1.0 (January 2025) release:

DetectAreasMode.NONE

Use DetectAreasMode.LEAN for recognizing simple images with a few lines of text without illustrations or formatting, prioritizing speed and reducing resource consumption.

DetectAreasMode.PHOTO

Use DetectAreasMode.UNIVERSAL for photos and screenshots.

DetectAreasMode.COMBINE

Use DetectAreasMode.UNIVERSAL for most documents.

DetectAreasMode.TEXT_IN_WILD

Use DetectAreasMode.UNIVERSAL for street photos.

DetectAreasMode.DOCUMENT

Use DetectAreasMode.MULTICOLUMN for recognizing multi-column layouts.

Examples

The code samples below illustrate the changes introduced in this release:

Recognizing multi-column layout

# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
input.add("source.png")
# Set document areas detection mode
recognitionSettings = RecognitionSettings()
recognitionSettings.detect_areas_mode = DetectAreasMode.MULTICOLUMN
# Recognize the image
result = api.recognize(input, recognitionSettings)
# Print recognition result
print(result[0].recognition_text)
input("Press Enter to continue...")

Optimize searchable PDF file size

# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.PDF)
input.add("source.pdf")
# Recognize the image
results = api.recognize(input)
# Save recognition result
save_multipage_document("result.pdf", SaveFormat.PDF, results, PdfOptimizationMode.BALANCED)