The goal of these tests is to evaluate the performance of HTJ2K under typical IIIF usage scenarios and using the kinds of image content typically used by users for IIIF
IIIF is most commonly used for pan and zoom via a browser to display images from the cultural heritage sector
This typically requires the use of an IIIF-compatible image server
Pan and zoom usage requires the ability of the IIIF server to rapidly extract regions from a source image at a specific size.
Objectively measure the real performance of the format for our use case and compare to JPEG2000 Part 1 and to TIFF for both lossy and lossless encoding
Which performance metrics are useful to measure?
How do different software implementations of HTJ2K compare?
How does HTJ2K perform in a real production environment?
All 1000 images compressed both lossy and losslessly using all the available codecs
→ 11 different output files for each of the 1000 Getty images
vips tiffsave input.tif output.tif --tile --pyramid --tile-width 256 --tile-height 256 -Q 90 --compression jpeg
opj_compress -i input.tif -o output.jp2 -r 8 -n 7 -c "[256,256],[256,256],[256,256],[256,256],[256,256],[256,256],[256,256],[128,128]" -b "64,64" -p RPCL -SOP -TP R -PLT -threads ALL_CPUS
kdu_compress -i input.tif -o output.jp2 -rate 3 Clayers=1 Clevels=7 Cprecincts="{256,256},{256,256},{256,256},{256,256},{256,256},{256,256},{256,256},{128,128}" Corder=RPCL Cblk="{64,64}" Cuse_sop=yes ORGgen_plt=yes ORGtparts=R ORGgen_tlm=8 -quiet
kdu_compress -i input.tif -o output.jp2 -rate 3 Clayers=1 Clevels=7 Cmodes=HT Cplex="{6,EST,0.25,-1}" Cprecincts="{256,256},{256,256},{256,256},{256,256},{256,256},{256,256},{256,256},{128,128}" Corder=RPCL Cblk="{64,64}" Cuse_sop=yes ORGgen_plt=yes ORGtparts=R ORGgen_tlm=8 -quiet
grk_compress -i input.tif -o output.jp2 -r 8 -n 7 -c "[256,256],[256,256],[256,256],[256,256],[256,256],[256,256],[256,256],[128,128]" -b "64,64" -p RPCL -S -tile_parts R
grk_compress -i input.tif -o output.jp2 -r 8 -n 7 -c "[256,256],[256,256],[256,256],[256,256],[256,256],[256,256],[256,256],[128,128]" -b "64,64" -p RPCL -S -tile_parts R -M 64
JPEG2000 can achieve significantly better compression than TIFF lossy (JPEG) or lossless (deflate)
HTJ2K compressed files are slightly larger than for JPEG2000 Part 1
Different JPEG2000 codecs produce very similar output
Each combination of format and codec compressed 3x with the times averaged
Large differences between codecs
Kakadu significantly faster for all types
HTJ2K encoding faster than JPEG2000 Part 1 especially for lossless encoding
Lossless JPEG2000 encoding faster than lossy encoding for all codecs and JPEG2000 types
For pan and zoom type use, decoding time is by far the most important criteria as encoding is only performed once offline
Essential processes that contribute to Latency during pan and zoom:
Use most widely used and fastest IIIF server:
IIPImage (https://iipimage.sourceforge.io)
The IIPImage server provides precise (microsecond) timing information for each internal process
A set of random IIIF tile requests created on a subset (the 50 largest images) of the Getty images
100 random IIIF tile requests made at different locations and resolutions for each image, resulting in 5000 requests in total
The same 5000 IIIF requests used for all decoding tests
Tiled pyramid TIFF is by far the fastest format for random tile access on large images
For JPEG2000, OpenJPEG remains significantly slower than Kakadu: 10x slower for lossy up to 15x slower for lossless
HTJ2K decoding is about 2x faster for lossy JPEG2000 and ~20% faster for lossless for both OpenJPEG and Kakadu
Tiled pyramid TIFF has a very optimized structure for random tile access, which is hard to compete with in terms of decode times
JPEG2000 capable of much better compression than TIFF
HTJ2K is both faster to encode and decode than JPEG2000 Part 1
HTJ2K files are slightly larger than JPEG2000 Part 1, but not by much
HTJ2K is compatible with current versions of both OpenJPEG and Kakadu
OpenJPEG remains, despite recent improvements, very slow with respect to Kakadu
IIIF servers such as IIPImage can decode HTJ2K without modification