image stream processing
1 posts in topic
Flat View  Flat View

Posted By:   dikran_seropian
Posted On:   Thursday, February 24, 2005 08:51 AM

I need to convert images (JPG, BMP, PNG, TIFF) to JPEG format with specified compression. The requirement is to convert them while the memory footprint is minimal, so without loading the whole image in memory. I should open the raw image stream -> read data -> compress data -> write compressed raw data. I took a look at sun's JAI but I could not figure how to do it. Any idea?

Thanks a lot.

Re: image stream processing

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, February 26, 2005 08:49 AM

I don't think you can do good compression just reading a stream and writing out a stream? because good compression involves going back and forth in the source file, to find common things to compress....

I don't know the details of JPEG file format, but usually in compressed formats there is e.g. some kind of dictionary, probably at the beginning of the file, and you may need to add things to the dictionary, dynamically, as you run across them, even later towards the end of the source file. So you have to go back to the dictionary and rewrite it, at the beginning of the output file, multiple times as you read through the input.
About | Sitemap | Contact