Streaming Conversions

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Scorp1us
Posts: 4
Joined: 2010-06-23T13:37:41-07:00
Authentication code: 8675308

Streaming Conversions

Post by Scorp1us »

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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Streaming Conversions

Post by magick »

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.
Post Reply