Thursday, July 12, 2007

Looking for IJG specialists

When I added the support of JPEg to VLIV, I tried to follow the "large images" philosophy, that is I am creating virtual tiles (in fact virtual strips), so only visible part of the file needs to be loaded.

Unfortunately the IJG library does not allow as is arbitrary positioning in the image, so I have to decompress the complete image up to the strip start position.

I subdivide the image in 256 pixels strips.

This is quite costly, as for example the more you go to towards the end, the more you have to decode "for nothing".
Imagine you have a 10000x10000 pixels image and a 1000x1000 display, and you want to display the bottom of the image.

This corresponds to 4 (or 5) strips, each requiring between 9000 and 10000 lines decoding
"for nothing", only to go to beginning of strip, so that while the memory used is much lower than storing the complete image, the CPU used is like 5 times the CPU used for loading the complete image.

There is clearly room for improvement.

Here is my code (repeated for each virtual strip):


// reading up to strip start, discarding results
for (idx = 0; idx < stripstarty; ++idx)
jpeg_read_scanlines(&cinfo, &dstptr, 1);
// reading stripheight
for (idx = 0; idx < stripheight && idxt < imageheight ; ++idx)
jpeg_read_scanlines(&cinfo, &dstptr, 1);


So if you are aware of any method that would speed up the first loop, that would be incredibly useful, and very large JPEG loading would be MUCH faster.

Or of course if you know a JPEG (preferably free) library that supports arbitrary region decoding, feel free to contact me.

Wednesday, July 11, 2007

Experimental support in VLIV for BigTIFF

I have checkout-ed this morning the libtiff CVS and compiled VLIV using this version (it's 4.0 beta I think).

This should allow BigTIFF files support.
I have tested on a few files, but did not go as far as getting large (huge, more than 4 gigabytes) files to better test.

Remember this is a giant step in supporting really large image, I cannot see a real limit other than disk space now, as a 1 Terabyte image only scratches the surface of possible file size with BigTIFF.

If you have large BigTIFF images, please test VLIV support for them and report any problem.

Sunday, July 8, 2007

A specific application for Vliv

The sources for large images seems to be more and more diverse.

I had some satellite data, scanned images from medical devices, numeric photographic stiched images.

A customer contacted me to get the Vliv source code and adapt it to a very specific usage : a kiosk mode for displaying digital art in a gallery. That means removing all the interface and binding functionnality to trackball and buttons.

The image he gave me is not that large (24000x12000) but try opening this in a standard viewer...

I have specifically written for him a script that creates a special pyramidal TIFF from his original painting, with the difference to standard pyramids beeing that the zooming ratio between different levels is not 1/2 but 9/10. That allows very smooth (un)zooming in the image, and classic tiling allows panning.