I work with some very large files. 80MB is common, up to 800MB I also have many conversions threads at once. Generally, I am either converting from some arcane 422 format to JPG2000, or downsampling. Rather than wait for the entire image to come in (via socket) I want to be able to feed it to a streaming processor that has an input context (format) then send it to the output context (format), but will only buffer a scan line or tile in memory. Depending on the conversion, it may buffer several scan lines at a time, which would be converted into several tiles. I just want the responsibility of handing data to it as it becomes available. I also want writing to start almost immediately. That is to say latency is minimized from my first byte read to the first byte written.
Can IM do this?
I have some esoteric data formats (like the 422, and other bit planes.) So it would help if I could specify that as a context separate from the pixel data.
Thanks!
Streaming Conversions
Re: Streaming Conversions
ImageMagick can read from a file descriptor and return data as it becomes available with the streaming interface. If you're using the MagickCore API, set the ImageInfo file member to your socket descriptor and call the ReadStream() with your callback method.