Hi Charles, Sanselan is a great project. I want to draw your attention to the fast thumbnail-feature for jpegs not available in java. I attached a mail where I describe the problem to somebody else.
Do you think you could implement this feature as part of Sanselan? Perhaps one could do it in such a way (e.g. special InputStream) so it could also be used together with ImageIO/JAI etc. What do you think? Cheers, Dieter 2008/7/26 Dieter Krachtus <[EMAIL PROTECTED]> > Hi Kenneth, > > The Problem with Java ImageIO: > Why is Java bad for multimedia - because we have no thumbnail-method > that is fast. > > Analysis of the problem: > - Java uses native ijg library (http://www.ijg.org) to load images. > - Programs like ACDSee and Picasa also uses ijg to load images and > thumbnails. > - So why are they faster by a factor 10-100 and and need far less memory? > - Answer: Java's ImageIO is not using the most valuable feature of ijg! > > Java uses JNI to take advantage of the ijg library. > This means Jpeg decoding (and also encoding is very fast). Still, if you > want to create thumbnails of hundreds of jpegs it still takes ages if you > need to decode the full picture and then scale it to thumbnail size. To > overcome this obstacle ijg allows you to get a picture 1/2, > 1/4, 1/8 or even 1/16 in size of the original picture. E.g. for a factor > 1/8, a 5000x5000 picture will be returned as 625x625 picture. > > Although Java uses ijg one cannot tell ijg to just load 1/8 of the image. > One always has to read and decompress all of the 5000x5000 pixels and then > draw it in a much smaller thumbnail. This is very slow and needs very much > memory! > > How does this feature allow fast thumbnails? > How does this feature of ijg work? If Java would tell the ijg library to > get a picture 1/8 in size of the original picture, the ijg library only uses > the DC components and skips all the AC components. This means it only has to > decrypt the DC component. It still has to do the full Huffman decompression, > but still it saves a hell lot of time, especially since it has to read much > less data from the disk. > > > How to fix this problem? > It took me a lot of time to track down this problem and get up-to-date with > the theory. Still I have little experience with the JNI-ijg bridge used in > ImageIO. I think the best way to do it is to extend the JNI interface and > allow the user to set 1/2, 1/4, .., in JPEGImageReadParam and communicate it > to ijg. > > > In my opinion this single feature would have more impact on Java's > multimedia capability then any other optimization I can think of. Video > being the exception. > > > > Cheers, > Dieter >
