Analytics

IIPAnalyze

IIPAnalyze is a tool for analyzing incoming IIP protocol image requests to the IIPImage server. It can tell you which are the most viewed regions of a particular image and display histograms showing tile usage, globally or per resolution level. It can also output hotspot image maps showing visually which regions of a particular image are most viewed for any given resolution.

Hotspots for Van Gogh\’s Room at Arles at resolution 6 and a gamma of 0.7
Histogram for Van Gogh\’s Room at Arles at resolution 6

IIPAnalyze simply requires a web server log file from Apache, Lighttpd, Nginx, Tomcat or IIS in the widely used standard Common Log Format. It parses the contents of the log file and compiles a histogram of all requested tiles.

It is possible to filter by image name, resolution number, IP address or user agent. Basic output is an ordered list of tile indexes and their frequency to stdout. If a hotspot map is requested, a greyscale tile map is produced showing which regions are the most visited. The brighter the region, the more this region has been viewed. If a histogram is requested, a graph plotting tile index vs frequency is produced.

Marble Earth: Hotspot map at resolution 9 with a gamma of 0.6

It is also possible (as of version 0.2) to plot histograms showing user activity over time:

Number of Tile Requests for Marble Earth by Firefox Users
Tile Request Frequency for a Random IP address

IIPAnalyze is a command line script written in Python and requires the Python Imaging Library in order to generate hotspot maps and (optionally) matplotlib if you want histogram plots.

Command Line Options

-l, –logfile
Web server log file in common log format
-i, –image
Full name of the image you want to search e.g. “/images/test.tif”
-r, –resolution
Index of the resolution (from 0 and the maximum available resolution of the image)
-a, –address
Filter by IP address
-u, –user
Filter by user agent
-o, –output
Hotspot image map (requires Python’s PIL to be installed)
-w, –width
Width of hotspot image map (must be used with –output option)
-b, –background
Apply background of image (contrast reduced) to the hotspot map (must be used with --output option)
-g, –gamma
Define a gamma to improve the visibility of low contrasted tiles (must be used with --output option)
-p, –plot
plot a histogram (requires Python’s matplotlib to be installed)
-t, –time
Plot the histogram of connection activitity with respect to time
-n, –bins
Select the number of bins for the time histogram
-d, –range
Select an interval of time on the time histogram

For example, to generate an image, hits.jpg of width 600px with background showing the distribution of tile hits at resolution 5 for image test.tif from the Apache access log use the following command:

python iipanalyze -l /path/to/access.log -i test.tif -r 5 -b -o hits.jpg -w 600

Download

You can download the latest stable release of IIPAnalyze from our download page or get the latest development code from the iipanalyze github repository.