DeepZoom: new Graphics::DZI release

There are two major additions:

  • The first allows you to use a whole image stack as canvas for your image pyramid.
  • The other provides you with a more convenient and shorter way where things are supposed to be stored.

Image Stacks

The amazing Image::Magick package can cope with images which are linked together:

use Image::Magick;
my $image = Image::Magick->new;
$image->Read('test1.png');
$image->Read('test2.png');
$image->Read('test3.png');

If you resize or otherwise operate on this compound image, the operations apply to all subimages.

The DZI package makes now use of that, in that you can pass in such a stack as your background canvas.

At the tile generation process, the very first image to be tiled (the one for the highest resolution) is now the image at the bottom of the list, or in other words, the last pushed onto the stack.

At the next higher resolution level, the next image is used, and so forth. If there is only one single image in the stack, then everything works as before. That way you can specify different canvases for different resolutions.

Note, that you need really large images, so that the effect becomes visible in the Seadragon AJAX client. For smaller images usually all tiles will be eventually loaded at the very beginning.

dzi parameter for the constructor

What has bothered me, is that the way to specify the target location is inconvenient:

use Graphics::DZI::Files;
my $dzi = new Graphics::DZI::Files (image => $image,
                                    path  => ...,
                                    prefix => ...);
$dzi->iterate ();  # generate the tiles

# open XML document
print $XML, $dzi->descriptor;

You would need the target location in different forms.

Now this looks a bit more civil:

use Graphics::DZI::Files;
my $dzi = new Graphics::DZI::Files (image => $image,
                                    dzi   => $dzipath);
$dzi->generate;

The generate method takes the dzi parameter, copies the descriptor there, and then also generates the tiles.

As god intended it to be.

Posted In

night owl

this is night owl, i come 2 haunt u

nightowl (not verified) | Wed, 06/02/2010 - 19:47

> i come 2 haunt u ...

So we two will meet in the dark. I am the one with the glowing red eyes...

rho | Thu, 06/03/2010 - 13:35