JPEG2000 thumbnails

I’ve been trying to find software for batch generation of thumbnails for JPEG2000 images. So far this is what I’ve looked at:

Kakadu is commercial software that looked hopeful at first, but the licensing is confusing. The description of the “Non-commercial, Named User Licence” says it “can only be purchased by individuals, Academic Institutions, not-for-profit organizations and libraries which do not gain financially by using this software,” but the license itself doesn’t say anything about licensing to institutions, only individuals. Our attempts to get a clarification have gotten no response. If they ignore us when we want to buy something, that doesn’t bode well for support.

OpenJPEG has its supporters, but it has a command line API which can’t create JPEG, GIF, or PNG, and it can’t create images of a specified size. There are C functions which may or may not be directly callable, but the documentation for them is really scanty.

ImageMagick didn’t seem appealing at first because of its command-line orientation, but it may be the best option. JMagick provides a JNI connection. The documentation indicates it can generate images of a specified size and format, which is what we need.

If anybody reading this has other suggestions, let me know.

10 responses to “JPEG2000 thumbnails

  1. ImageMagick will be the easiest option, but it depends on the JasPer JP2 implementation which is buggy in places and the development of which appears to have stagnated. No updates for a few years now. OpenJPEG is much more lively, but as you note, you’ll have to push the output to ImageMagick to reduce the size.

    Having said that, there is a subtle point you might wish to take advantage of. Both Kakadu’s kdu_expand and OpenJPEG’s j2k_to_img have a ‘reduce’ option, which only extracts the data from the first few resolution layers. If your JP2 have been composed to make use of this feature, this makes extracting suitable thumbnail images very fast, as it only reads data from the start of the file.

    Hope that helps.

    • We have JPEG2000’s from a variety of sources, so we can’t count on any particular features. At this point ImageMagick looks like the way to go, though I hope it doesn’t cause any problem with its bugs.

      Another option is Luratech’s ICS, which we already have a license for; the downside for us is it would restrict us to the servers which are licensed unless we wanted to throw a significant amount of money at them. Luratech has also stagnated on its JPEG2000 support because it’s focusing on PDF/A these days.

  2. In addition to Andy’s comments about ImageMagick + JasPer: my own experience is that you’re likely to encounter performance problems. The JasPer library is slow and its memory management isn’t exactly great (to put it mildly), so large images may result in unexpected crashes.

    Another option that might be worth checking out is Aware’s JPEG 2000 SDK, which is probably able to do this as well. Incidentally we’re using their SDK (well actually its command-line interface) here for a major TIFF to JP2 migration project, and I’m really quite happy with it. This solution might be a bit on the expensive side if you only need it for generating thumbnails though.

    • If it’s crash-prone, that’s an argument for invoking ImageMagick by a Java call to exec rather than using JNI, since a separate process can’t damage the Java web application which will invoke it.

      We have an ancient license for Aware, but I suspect it would be at least as unreliable as ImageMagick if we didn’t get a current update.

    • I’ve just gotten word that paying for an Aware license is not an option.

    • “Slow” is an understatement. In tests it took ImageMagick over 30 seconds to generate a single thumbnail in some cases.

  3. Oh, and Aware has a Java JNI interface as well, I now see (well at least under Windows, not sure about other platforms)

  4. This might be interesting as well (although I’ve never used it myself):

  5. Hi Gary,
    I’m a Technical Design Engineer for the National Archives, a colleague of mine thought I could comment. About two years ago I was faced with a similar challenge, to compress about 15m tiffs in to JPEG2000. Like you I looked around and considered render farms, but ended up working with a company called Intopix who produce hardware solutions for JPEG2000.
    We worked together for about a year to develop the solution, until we had a working platform that using five servers can compress about 50,000 images an hour. The system uses a hardware accelerator card and command line app provided by Intopix, I’m sure if you contacted Katty Van Mele there, she’ll be able to help you.