How to determine whether an image is streamable?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
abukaj
Posts: 4
Joined: 2014-06-17T02:51:11-07:00
Authentication code: 6789

How to determine whether an image is streamable?

Post by abukaj »

I am developing a server for automated processing of BIG images (size of 22500x17500 is not the greatest possible)
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
How can I determine, whether an image can be streamed in a reasonable amount of memory, and with no temporary file use?
I can of course use:

Code: Select all

$ ulimit -v 512000 -n 5
and check if stream crashes, but I look for a more elegant solution.
Post Reply