var image = (RasterImage) Image.load(is);
image.binarizeFixed(175);
on the attached image throws an error:
Can't binarize image.
class com.aspose.imaging.coreexceptions.ImageException: Can't binarize image. ---> class com.aspose.imaging.coreexceptions.ImageException: Can't binarize image. ---> class com.aspose.imaging.internal.Exceptions.ArgumentException: The rectangle has no common processing area. Cannot proceed.
...
Attaching an image and the full stack trace: example.zip (4.0 MB)
I have opened a ticket with ID IMAGINGJAVA-1806 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
Can you please consider using latest Aspose.Imaging for Java 20.12 and also increasing heapsi size to give to java 6 gigabytes of memory this way:
java -Xms6G -Xmx6G TestClass
We cannot consider it to be ab issue and its necessary to give Java at least 6Gb (six) RAM.
This is because during binarization all pages (170) of image will be loaded into memory, each page have resolution 2550x3300 pixels (4 bytes for 1 pixel), multiply it to 170 and you get 5 722 200 000 bytes for store.
To minimize this memory requirement you may use batch processing as below.