kdu_compress settings for Loris and OpenSeadragon

419 views
Skip to first unread message

Barbara Hui

unread,
Feb 3, 2015, 5:28:57 PM2/3/15
to iiif-d...@googlegroups.com
Hi All,

I'm working on the UCLDC project (https://wiki.library.ucsf.edu/display/UCLDC/UCLDC+Implementation) at CDL with Brian Tingle et al, and am working on setting up a IIIF image server and image viewer for us. I've managed to install Loris and have it fetching images from AWS S3 buckets, which is great.

I'm now working on converting our master tiffs into jpeg2000 format, and am playing with Kakadu's kdu_compress to try and do this. I was wondering if you have any recommendations on which options to use in order to produce jp2s that are optimized for Loris + OpenSeadragon? We don't necessarily need lossless compression since we'll be hanging on to the archival tiffs.

Thanks!
-Barbara

Petr Pridal - Klokan Technologies GmbH

unread,
Feb 4, 2015, 2:45:10 AM2/4/15
to iiif-d...@googlegroups.com
Hi Barbara,

I have put some of the related comments and scientific articles about the subject at http://help.oldmapsonline.org/jpeg2000 (check also the pdfs down on the page).

Large images definitely need precincts and enough resolution levels.

IIPImage JPEG2000 / IIIF Server can take advantage of quality layers as well, when some can be ignored for faster decoding.

I would be keen to see a performance test once - comparing IIPImage vs Loris vs other implementations - maybe a task for one of future IIIF meetings / hackathons?

Petr

-Barbara

--
-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "IIIF Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iiif-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Petr Pridal, Ph.D.
(managing director)

Klokan Technologies GmbH
Hofnerstrasse 96, 6314 Unterageri, Switzerland
Tel: +41 (0)41 511 26 12
Email: in...@klokantech.com
Web: http://www.klokantech.com/

Henshaw, Christy

unread,
Feb 4, 2015, 3:25:19 AM2/4/15
to iiif-d...@googlegroups.com

Hi Barbara,

 

The JPEG2000 wiki on the Open Planets Foundation site hasn’t been updated in a while, but there are profiles from several organisations on there currently in use for JPEG2000, and you’ll also find a link to the JPEG 2000 report Robert Buckley wrote for us, which talks about Kakadu compression: http://wiki.opf-labs.org/display/JP2/Home.

 

Best,

Christy



This message has been scanned for viruses by Websense Hosted Email Security

Jon Stroop

unread,
Feb 4, 2015, 11:38:06 AM2/4/15
to iiif-d...@googlegroups.com
Barbara,
If you're just getting started, JP2 can be pretty intimidating. Your source image quality and subjects greatly informs the amount of compression you can apply, the type of viewer and/or server you're running may have different requirements or optimizations, etc....

As far I as know Loris will handle any JP2 you hand to it at this point. The same thing Petr said about IIP goes for Loris: you'll see better performance if you have tiles or precincts and resolution levels that can be discarded for smaller requests. For example, at Princeton, most of our images are between 7-10K pixels on the long dimension (though some are MUCH larger) and so we've found that 7 levels and  1024px tiles (we actually have a mix of images with tiles and precincts in our collections) seem to strike a good balance between bandwidth, server, and client concerns. We also have a lot of images that don't compress very well, and so we've stayed fairly conservative with our compression ratio and tend to use 10:1. Here's a "recipe" you might use to get started:

kdu_compress -rate 2.4,1.48331273,.91673033,.56657224,.35016049,.21641118,.13374944,.08266171 \
 Creversible=yes Clevels=7 Cblk=\{64,64\} \
 -jp2_space sRGB \
 Cuse_sop=yes Cuse_eph=yes Corder=RLCP ORGgen_plt=yes ORGtparts=R \
 Stiles=\{1024,1024\} \
 -double_buffering 10 \
 -num_threads 4 \
 -no_weights
 -i <input>.tif -o <output).jp2

This makes: up to 7 levels, 1024px tiles, applies 10:1 compression and then about 35% more on each smaller resolution level (I think--don't ask me about that part...I trust the photographers :-) ), and assumes you have a color image (I think you can get rid of "-jp2_space sRGB" if you have grayscale images, or perhaps replace it with "-jp2_space sLUM").

Everyone on this list will have a different opinion and different recipe, and you'll likely need to tweak some of the dials to find yours, but it's a place to start.

Regarding OpenSeadragon: I found a little bug the other day, where OSd never requests the "full" image at the lower levels but instead requests, which it should do, according to the IIIF canonical syntax[1]. The current version of Loris is optimized for that syntax (though the others work; just not quite as quickly). I'm working on a pull request for OpenSeadragon and should have it in by the end of the day today. You'll see a decent performance boost once that's merged.

Hope this helps,
Jon

1. http://iiif.io/api/image/2.0/#canonical-uri-syntax

Barbara Hui

unread,
Feb 4, 2015, 1:13:01 PM2/4/15
to iiif-d...@googlegroups.com
Petr, Christy and Jon,

Thank you very much for your quick responses! This gives me a lot to chew on and experiment with. I'll let you know how it goes. I am indeed just getting started with JP2 (and images in general, really), so the number of parameters is a tad overwhelming. All of this info -- and especially the concrete recipe -- is really helpful.

I think it might be tough to truly optimize for all of the UC images since we're working with so many different sources and hence sizes/quality etc. Maybe I can figure out different compression parameters based on those variables...

Jon, thanks for the note re OSd. I'll pull down that commit.

Thanks again!

Best,
-Barbara


From: iiif-d...@googlegroups.com [iiif-d...@googlegroups.com] on behalf of Jon Stroop [jpst...@gmail.com]
Sent: Wednesday, February 04, 2015 8:38 AM
Reply all
Reply to author
Forward
0 new messages