1
votes

Which lossless compression algorithm [between LZW or JBIG] is better for compressing data sets consisting of images (colored and monochrome) ?

I have implemented both and tested on smaller data sets [each containing 100 images] and have found inconclusive results.

Please Note:: I cannot use Lossy compressions like Jpeg because the data after decompression has to be identical to that of the source. Neither I can other lossless algorithms like PNG as they are not supported by the firmware which is responsible for the decompression.

2
For images, neither LZW nor, generally, JBIG is a good choice. If your goal exceeds gauging these two, state it for more helpful answers. ("Lossless" applied to images may be part of a misconception: If that image is from "sensors" (say, a camera), the "original" has at least undergone spatial and value quantisation. Then, there is noise, (optical) aberration, …) - greybeard

2 Answers

2
votes

Neither LZW or JBIG are optimal, although JBIG (JBIG2) should give you better results.

LZW is not designed for images (e.g., it does not exploit 2D correlation), and JBIG. JBIG (perhaps you mean JBIG2?) does exploit the 2D correlation, although it is designed for monochrome images such as fax pages.

Of course, results will depend on your particular dataset, so if results are inconclusive the best thing you can do is to test on more images (and perhaps differenciate between color and grayscale images).

If your firmware supports it, I would also test JPEG-LS (https://jpeg.org/jpegls/), which in my experience gives good overall lossless compression performance.

0
votes

JPEG-LS or JPEG 2000 would give better results. You can think about WebP or JPEG XR as well.

Note: If you want to render compressed image to browser then you may need to take the browser support into account. e.g. JPEG 2000 supported by safari, WebP supported by chrome and android browsers, JPEG-XR supported by IE11 & Edge likewise.