Images
Image Formats
In order to maximize the speed and efficiency of the system, the source images must be in a multi-resolution tiled pyramidal format. This allows for rapid access to individual image tiles at any resolution with minimal server overhead. The is especially important for very high resolution images. The Tiled Pyramidal TIFF format is the only file format currently supported, though other multi-resolution formats such as JPEG2000 will be added in future versions. In addition, support for flat JPEG will be added in the next release to allow IIPImage to be integrated into standard image gallery systems for use with consumer digital cameras.
Images can be in either 8 bit or 16 bit format and in a greyscale, sRGB or CIE L*a*b* colour space.
Tiled Pyramidal TIFF
Tiled Pyramidal TIFF is simply a tiled multi-page TIFF image, with each resolution stored as a separate layer within the TIFF. This is a standard TIFF extension and is supported by most image processing applications including Photoshop, GIMP, VIPS and ImageMagick. The libtiff codec library is also perfectly capable of reading and writing such images.
Tiled Pyramidal TIFF images can also be optionally compressed using Deflate, LZW or JPEG.
In order to test the server, you may use this example TIFF image.
Conversion using VIPS
These images can be created using the VIPS image processing suite (NOTE: version 0.9.5 of the IIPImage server and earlier require Tiled Pyramidal TIFF images produced with the VIPS stable 7.8 branch or earlier only. For users of iipsrv version 0.9.6 and later, use the latest stable or unstable VIPS releases). To generate a tiled pyramidal TIFF image use Nip2, the VIPS GUI or use the command line.
vips im_vips2tiff <source_image> <output_image.tif>:<compression>,tile:<size>,pyramid
- source_image: can be any kind of image supported by VIPS
- output_image.tif: your TIFF output image
- compression: either none, deflate, LZW or JPEG
- size: pixel dimensions of tiles, eg: 256×256
For example, to generate a TIFF with deflate compression and a tile size of 256×256, use:
vips im_vips2tiff source_image output_image.tif:deflate,tile:256x256,pyramid
It is also possible to generate tiled pyramidal TIFF images with JPEG compression at quality 75:
vips im_vips2tiff source_image output_image.tif:jpeg:75,tile:256x256,pyramid
Conversion using ImageMagick
You can also use ImageMagick to create Tiled Pyramid TIFF. This only works with version 6.4.7-10 and upwards. In this case use the convert command. For example, to generate a 256×256 pyramidal tiled tiff:
convert s -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:o.tif'
- s: source image - can be any kind of image supported by ImageMagick (almost all)
- ptif: specify your image format as pyramidal tiff
- o.tif: output image - *MUST* have tif or ptif extension;
- 256×256: the tile size
Image Security and Storage
Images do not need to be directly accessible by the client via the web server (Apache, Lightttpd etc). They, therefore, do not need to be in the web server document root or in any subdirectory. The user, therefore, does not need to have access to the full resolution image. The images can be stored in any directory (or mounted directory via NFS, for example) on the machine on which the IIPImage server iipsrv executable runs.
The image paths given to the IIPImage server via the FIF variable must be absolute paths on the server machine (eg. FIF=/images/test.tif) and not paths relative to the web server document root location. Don’t forget to make sure the IIPImage server process owner has read access on the images! On Windows, you should still use forward slashes “/” for the image path, not “\” and there is no need for the “c:” prefix.
You can also use the operating system’s access control to grant read access permission to the iipsrv process for specific directories or images only.
