HTML JPG OCR XML BMP
Aspose.OCR  for C++
TXT

Aspose.Imaging for Java

processes scanned images or even smartphone photos in GIF format and creates GIF documents containing recognized text. To add it to your project, you just need to get Aspose.OCR

Aspose Maven Repository or specify Aspose Maven Repository configuration and install it within your Maven-based project by adding the following configurations to the pom.xml. For Graddle, Ivy, Sbt examples check out our repository .

Package Manager Console Command


  PM> Install-Package Aspose.OCR.Cpp

With C++ OCR and just a few lines of code, you can create full-featured application that converts an GIF image to TXT document:

  • Create an instance of AsposeOcr class
  • Call AsposeOCR.asposeocr_page() method
  • Pass the GIF file path as parameter
  • AsposeOCR.asposeocr_page returns a String or file of TXT type

System Requirements

Before running the example, make sure that Microsoft.ML.OnnxRuntime 1.7.0 or above is added to the project. It should be automatically installed if you install Aspose.OCR via NuGet Package Manager.

  • NET Standard 2.0+ compatible solution
  • Aspose.OCR for .NET referenced in your project.


std::string img_path = "../srcSample.png";

// Prepare buffer for result (in symbols, len_byte = len * sizeof(wchar_t))
const size_t len = 4096;

wchar_t bfr[len] = { 0 };

size_t result = aspose::ocr::page(image_path.c_str(), bfr, len);

//Print result
std::wcout << bfr << L"\n";
  • GIF What is GIF File Format

    A GIF or Graphical Interchange Format is a type of highly compressed image. Owned by Unisys, GIF uses the LZW compression algorithm that does not degrade the image quality. For each image GIF typically allow up to 8 bits per pixel and up to 256 colours are allowed across the image. In contrast to a JPEG image, which can display up to 16 million colours and fairly touches the limits of the human eye. Back when the internet emerged, GIFs remained the best choice because they required low bandwidth and compatible for the graphics that consume solid areas of colour. An animated GIF combines numerous images or frames into a single file and displays them in a sequence to generate an animated clip or a short video. The colour limitations are up to 256 for each frame and are likely to be the least suitable for reproducing other images and photographs with colour gradient.

    Read More

    TXT What is TXT File Format

    A file with .TXT extension represents a text document that contains plain text in the form of lines. Paragraphs in a text document are recognized by carriage returns and are used for better arrangement of file contents. A standard text document can be opened in any text editor or word processing application on different operating systems. All the text contained in such a file is in human-readable format and represented by sequence of characters.

    Read More

    TXT (Text Document File)
    Text (Text Document File)
    DOC (Documents generated by Microsoft Word)
    DOCX (Microsoft Word documents)
    XLS (Microsoft Excel Binary File Format)
    XLSX (Microsoft Excel documents)
    PDF (Portable Document Format (PDF))
    Searchable PDF (Searchable Portable Network Graphics )