Yes, I have tried PNG, JPEG and JPG.
Today, while testing, I realised something that I had missed before: the program works and the ocr does not give any error but only if the image taken locally is already present in its directory.
The problem is that the OCR is inserted in a wider context and the image is created at runtime. In this case, it is not the image that cannot be read (because if you stop the program and read the image again, the program will work properly), but somewhere else.
The fact is that with this same script that creates the images I tested Tess4J and it worked (even if it had big defects as OCR).
Perhaps I need to insert some delay after the image has been created, even though the aim of this project was to speed up slow operations.
Are there precedents for this type of problem? Thanks