To process them in a finite memory I need to convert them first into an RGB stream.
Stream (described as "a lightweight tool") seemed to be a perfect tool to do so, however after some benchmarking I discovered that there are formats (like JPEG2000 or even grayscale PNG without interlace) for which stream is not "lightweight" - instead it hogs a vast amount of memory:
Code: Select all
$ /usr/bin/time -f '%M' stream -identify R602_s154_BDA_NR_10x_plainGS.png /dev/null
R602_s154_BDA_NR_10x_plainGS.png PNG 22500x17500 22500x17500+0+0 8-bit PseudoClass 256c 50.15MB 22.800u 0:17.699
12319344
I can of course use:
Code: Select all
$ ulimit -v 512000 -n 5