Fixing bugs in Java JPEG2000

As its name suggests this image compression coding system was created in 2000 by Joint Photographic Experts Group Committee. JPEG2000 image compression technique has significant amount of advantages as compared to JPEG. JPEG2000 has better performance when the image is downscaled to lower bit rates.  Up scaling downscaled image barely loses visual pixel display(known as Lossless compression).Core factor for this better performance is ringing artefact signal processing capability of JPEG2000 therefore the box shaped edges displays as curved where it is applicable. Additionally JPEG2000 decomposes the image into a multiple resolution representation in the course of its compression process. So developers can switch into any resolution they desire. By Default JPEG2000 (named as jj2000) is plugged into java’s JAI api . This software module was originally developed by Swiss Federal Institute of Technology-EPFL.

jj2000 uses a complex encoding and decoding algorithm (please refer to StdEntrophyDecoder and StdEntrophyEncoder.java classes ) which undergoes several number of wavelet transformation in order to maintain the image quality to top to bottom levels. which works fine in small scaled images but not in large scaled images.

The algorithm is designed in jj2000 is to result high performance in images with a pixel ratio of 2048 x 2048 or less and you may encounter black blotches or fully or partially blanked images if it is compressed using jj2000. This issue is identified in several cases where the image is scanned.

As I mentioned earlier images are wavelet transformed in maximum number of 30 bit planes in jj2000. 30th bit plane is rarely used and used mainly in large images and some black and white small images.  So the transformation is processed in descending order such as 30 ..29 ..28 and so on. If an error occurred in previous bit planes has affects in following bit planes too.  Bit plane thirty can be removed in large images to eliminate black blotches and blank image display, but unfortunately the elimination of bit plane number 30 reduces the contrast level to minimum. [Please note: if you remove the bit plane 30 in small images where pixel rate is below 2024* 2024 you may not see the image at all].

Interestingly the image contrast can be increased explicitly by multiplying Steps by 2.0 in StdDequantizer.java class (i.e: steps = steps * 2.0f ). Eventually you will get a very similar image to the original.

Do we need microscopes to find faults in jj2000 compression?

Ebook Page Link

The following two tabs change content below.

suda

Java EE developer at IDRSolutions
Suda is the Senior Java EE Developer at IDR Solutions, and specialises in XFA, Fonts, True-Type Fonts, application servers and conversions. He is a keen science-fiction fan in his spare time.

Related Posts:

suda

About suda

Suda is the Senior Java EE Developer at IDR Solutions, and specialises in XFA, Fonts, True-Type Fonts, application servers and conversions. He is a keen science-fiction fan in his spare time.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>