Thursday, September 8, 2016

JPEG 2000 - The good, the bad and the ugly

JPEG2000 has emerged as the preferred transfer syntax for archiving medical imaging.  If you ask most people why JPEG2000 is so popular, most will state that it offers the highest lossless compression ratios.  While images can be archived using lossy compression algorithms (which feature higher compression ratios), most have elected to archive using lossless to avoid any possible risk associated with image degradation that occurs in lossy image compression.  Compression ratio is important because it directly impacts storage costs to archive.

While some believe that JPEG2000 is the ultimate compression algorithm, this isn't necessarily true for everyone - there are some bad and ugly aspects to JPEG2000 that are not well understood:

The Good:

  1. JPEG2000 delivers one of the highest lossless compression ratios. 
  2. JPEG2000 supports progressive image transmission through several mechanisms
    1. A discrete wavelet transform is applied to the pixel data which breaks the image down into multiple resolution levels.  Lower resolution versions of the image can be viewed with a portion of the entire JPEG2000 encoded bitstream
    2. Wavelet coefficients are encoded as bitplanes and can therefore be decoded a bitplane at a time
    3. Certain pixels (regions of interest) can be encoded before others allowing them to be displayed first
  3. JPEG2000 supports a variety of pixel formats - 8 bit gray, 16 bit gray, 8 bit color (and others not typically used in medical imaging)
  4. JPEG2000 supports lossy and lossless encodings
  5. JPEG2000 delivers excellent image quality in lossy compression mode when compared to other compression algorithms
  6. JPEG2000 combined with JPIP is a very effective way of delivering images from a server to a client and is a DICOM standard
  7. There are several open source implementations of JPEG2000 including some GPU accelerated versions.  Intel has low level libraries that can be used to decode JPEG2000 using the advanced features found on their modern CPUs
  8. JPEG2000 is a supported image encoding for PDF files
The Bad:
  1. New compression algorithms have been developed that claim to beat JPEG2000 in compression ratio, encode speed and decode speed (e.g. WebP, BPG, JPEG-XR, FLIF)
  2. Very few products have leveraged the advanced features of JPEG2000 due to the associated complexity.  
  3. JPEG2000 has not been widely adopted in the technology industry.  
    1. Popular frameworks such as .net, java and node.js have poor or non existent support for JPEG2000.  
    2. Most web browsers are unable to natively display JPEG2000 images.  Safari has support but access to 16 bit gray data is unknown
    3. Few digital cameras are capable of encoding JPEG2000 images.
The Ugly
  1. JPEG2000 is an extremely complex algorithm which requires a high level of expertise in image compression and software engineering to implement.
    1. There are very few SDK implementations of JPEG2000 in the world - my guess is there are less than five complete SDK implementations and less than 20 unique SDK implementations.  Lack of SDK implementations makes it difficult for developers to add support for JPEG2000
    2. Not all implementations implement all features.  JPIP in particular is only implemented by two or three libraries
    3. Interoperability issues have occurred due to misinterpretation of the standard or bugs in the implementation
  2. JPEG2000 is extremely CPU intensive.  While CPU power is plentiful today, JPEG 2000 encoding and decoding is often the main bottleneck experienced in medical image systems.
Have questions or interested in learning more about JPEG2000 or image compression?  Post a question or suggestion for another article!

Update: Mathieu Malaterre provided the following link to JPEG2000 implementations

5 comments:

  1. Great post, Chris. Kinson Ho and I had a paper in JDI that touched on JPEG2000 (and wavelet compression in general) in one section, but you provide much more detail on this misunderstood topic. Here is the paper, if you are interested: http://link.springer.com/article/10.1007/s10278-014-9693-0/fulltext.html

    ReplyDelete
  2. Don - oh wow that is a great paper you and Kinson wrote, thank you for the link!

    ReplyDelete
  3. It is unfortunate that Jpeg2000 didn't get the expected wide support especially on web browsers. One of the formats that seemed promising at one point is WebP -an open source codec developed by Google and can produce higher compression ratio with support to lossless compression.

    No sure what the future looks like for both of these compression formats but WebP is currently supported mainly on Chrome browsers and some Opera versions https://developers.google.com/speed/webp/faq
    hopefully it makes its way to the medical imaging and the DICOM standard to drive wider adoption.

    ReplyDelete
  4. There are lots of new image formats out there and it isn't clear yet which (if any) will displace PNG, JPEG (or JPEG2000). I understand that the DICOM committee is open to new compression algorithms (I heard they are looking at HVEC) but I am mixed as to whether or not we need another one or not. New standards like DICOMWeb make me think the need for archiving in DICOM P10 will subside allowing archive vendors to store in whatever formats they want.

    ReplyDelete
  5. Enhancing in PDF editor possibly the primary thought occurred to many people, truly it isn't straightforward because it sounds to be. If you want to learn more about this topic please visit onlineconvertfree.com

    ReplyDelete