Wednesday, June 20, 2007

Implementing JPEG2000 in Vliv

The JPEG2000 format looks quite promising, because of its compression ratios and also because of features such as Regions Of Interest . So I am looking at implementing support in VLIV.

There are few libraries available (I am not counting professional and expensive ones):
  1. Jasper, free
  2. OpenJPEG free, OpenSource
  3. J2K-Codec, commercial
I have registered and tested J2K-Codec. The API is very simple and well adapted to Windows usage, in fact I have been able to integrate it in a few 10's lines of code. It is also very fast. However the LITE version (49$ + VAT) does not allow loading images with more than 5 resolutions. That is a problem because I cannot afford the Pro version that does (199$ + VAT). I would rather have a slower LITE version than a one I cannot use at all on some images.

I have not yet understood how tiling works with resolutions in JPEG2000, all I need is a simple way to load part of the image, per-resolution. Right now large images cannot be loaded because complete resolution takes too much memory.

If you wish to help on getting JPEG2000 support in Vliv, then contact me for source code. I am particularly interested on Very Large Images handling (aka tiling or ROI).

Another source of very large images (but not gigapixel)

Here is another source of Very Large Images (largest I found is 26267 x 20676, about 1/2 Gigapixel).

The images are taken with Onboard NASA’s Mars Reconnaissance Orbiter, the HiRISE camera.

They are available in the JPEG2000 format that I am experimentally adding to VLIV
Next post will discuss the JPEG2000 library I am using now.

HiRISE Web site

Monday, June 4, 2007

A complete movie in one image

A friend of mine had this idea : make an image containing all frames from a movie.
So I have experimented a little and I have found it's quite easy to do this.

I am starting from an AVI that is about 700 Megabytes.

The first step is to reduce the size of the movie (so that size is 320x176 for example), using VirtualDub and a non-compressed RGB destination.

Next step is generation of individual frames. I use a two line AVISynth script, run the script in VirtualDub, and voila, 144499 jpeg images, each beeing a frame of the movie.

Next I use some custom code to recreate a single TIFF file with all images appended in a 250x166 tiling (64000x42416 pixels). Actually I take only 1/3 of the images because it would not fit in 32 bits.

Then I use my custom software to generate the TIFF pyramid.

The result is a 1 761 000 bytes file that allows zooming/panning in the movie.

Here is the most unzoomed image (reduced 50% from original size). Can you guess the movie I used ?

Another Gigapixel by Scott Howard

This time it's Chicago at night. Viewable through a Zoomify Flash interface.