-1
$\begingroup$

For instance, a high-resolution image (25MP) and a low-resolution image (4MP) of the same scene. When compressing them both with JPEG-LS lossless, which of them achieves a higher compression rate and why? How would the file size ratio approximately look like?

Thoughts

Probably achieves the image with the higher resolution a higher compression rate, since lots of pixels in the same detail are similar or equal. But I have no clue how to approximate the file size ratio.

Further Thoughts

I am only able to calculate the uncompressed file size of the images under the 8 bpp assumption this gives a 75 MB and 12 MB image. Somewhere, I read that lossless compression in general leads to a compression rate of 2:1 [1]. Thus, a 37 MB and 6 MB compressed image. However, that doesn't solve my problem and contradicts my initial assumption (compression works well on lots of similar pixel-values). But that can't be, can it?

$\endgroup$

closed as unclear what you're asking by Marcus Müller, MBaz, Stanley Pawlukiewicz, lennon310, Matt L. Jul 15 '18 at 7:53

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ just like your last question: Please explain what you've figured out so far? also, you could literally have tried yourself, and answered parts of your question. So, please don't just "dump" questions on us – explain how far you've come, and what specific problem you're having that can't be solved with reasonable amounts of research yourself. $\endgroup$ – Marcus Müller Jul 6 '18 at 12:35
  • $\begingroup$ Probably achieves the image with the higher resolution a higher compression rate, since lots of pixels in the same detail are similar or equal. But I have no clue how to approximate the file size ratio. $\endgroup$ – cz5 Jul 6 '18 at 12:46
  • $\begingroup$ I extended the question. $\endgroup$ – cz5 Jul 6 '18 at 13:34
  • $\begingroup$ can you explain why you think this leads to better compression? That would directly help yourself and us answer your questions. Convert your "I think" to "I think because of {REASONS based on understanding}". $\endgroup$ – Marcus Müller Jul 6 '18 at 13:42
  • $\begingroup$ I repeat: Since lots of pixels in the same detail are similar or equal. If I would know the answer already, I wouldn't ask here. $\endgroup$ – cz5 Jul 6 '18 at 13:52
0
$\begingroup$

How to Approximate the File Size Ratio of Two JPEG-LS Compressed Images? For instance, a high-resolution image (25MP) and a low-resolution image (4MP) of the same scene. When compressing them both with JPEG-LS lossless, which of them achieves a higher compression rate and why?

All things being equal and if you account for the difference in volume of data, both images will compress approximately the same with the low resolution image compression ratio being an approximation of the high resolution image compression ratio by a factor that is proportional to $\frac{25}{4}$.

The file size of an image that is being compressed depends on the complexity of the depicted scene (all else being equal). Given a lossless compression algorithm, the picture of an average multi-storey building will have smaller file size than the picture of the branching structure of a tree shot in fall and a picture of a brick wall will have smaller file size than the picture of pebbles on a pebble beach.

Shannon proved that the best a sequence can be encoded to and remain decodable exactly ("...lossless encoding...") is up to the entropy of the source.

Entropy is a metric of randomness and unpredictability. Low entropy means that the source is predictable, high entropy means that the source is unpredictable.

Low entropy sources have high compression ratios and high entropy sources have low compression ratios.

Here is a low entropy source having two source symbols $\left\{ 0,1 \right\}$

$$00000000000000000000000000000000000000000000100000000000000000000 \ldots$$

Here is a high(er) entropy source having the same symbols: $$00101011010100101010100010101011010101010101001010101010010101010 \ldots$$

If you had to find a recipe to tell someone how to construct the first sequence, that would be straightforward: 44 zeroes followed by a 1 followed by 20 zeros". But the second sequence, even if you find SOME repetitive fragments it is difficult to be expressed in a more compact form.

Lossless compression schemes are trying to reduce redundancy, or in other words, find repeatable patterns in the data stream. Lossless JPEG is no exception.

But how does this give you the ability to predict that the picture of a tree compresses less than the picture of a multi-storey building?

Substitute "source" for "image". In the case of optical images, the "source" is the process that gives you the numbers that make up the image.

The point is that [the multi-storey building] is basically the picture of a "hole" (a window, a door, the balcony) tiled $M \times N$ times across the face of the building. This makes the pixels of the picture predictable. But in the case of natural images such as the branching of a tree or the close up picture of pebbles on a pebble beach, it is impossible to find long repetitive sequences and inevitably you need to spend "more words" to describe the image exactly.

So, compression ratio depends on how complex the scene is but what about the difference in resolution? How can you be so sure that the low resolution image is an approximation of the high resolution image?

For that, you rely on what is known as the "Data Processing Inequality". It is impossible to increase the information of a signal just because you processed it. In other words, you cannot know more than what you allow yourself during data capturing.

But, where is the processing here?

In a couple of places. The low resolution image of the same scene is a resampled version of the high resolution image. Shrinking an image, reducing its resolution, involves averaging of the image pixel values. During averaging, the entropy is decreased because the averaging produces smoothly changing values. It reduces detail.

Therefore, resampling the image from $25$ MP down to $4$ MP produces an approximation of the original image in which the bandwidth has been reduced by $\frac{25}{4}$ times and so has its entropy by a proportional factor. If you take into account these proportional differences you will find that the compression ratios are approximately the same, with the low resolution image being an approximation of the high resolution image compression ratio.

Exactly the same consideration would hold if you actually used a lower resolution sensor or a "thicker lens".

How would the file size ratio approximately look like?

The above provide guidelines. In practice, algorithms might be sub optimal because of various constraints. For example, if Lempel Ziv Welsh (LZW) runs out of memory for its dictionary half-way through a file it resets it. This results in a sub optimal compression ratio. Similarly, the "memory" of the predictor in JPEG-LS is limited, the "length" counter in run length encoding (RLE) is finite, etc.

These constraints turn the above numbers into bounds. You approximate certain values but with the exception of trivial examples, you cannot achieve the ideal values.

It is impossible to work out exactly what the file size for a given scene would look like but if you calculate compression ratios empirically for various scenes you might be able to gauge an approximate value.

Hope this helps.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.