Higher resolution or lower compression JPG's?

The question often arises as to whether to choose high resolution at high compression or low resolution at low compression, if both result in the same file size. As a test, I have chosen an image that has proven to be challenging for JPG so that we can see the limits of JPG compression. Below are two versions of the image at resolutions differing by a factor of two:



High resolution

Uncompressed

file size = 70,106 bytes High resolutionUncompressedfile size = 70,106 bytes

Low resolution

Uncompressed

file size = 17502 bytes

Following are JPG's of the same two images, with compression chosen to yield approximately the same file size for each:



High resolution

File size = 3,984 bytes

Low resolution

File size = 4,068 bytes

Now let's magnify these images to make the differences easier to see.



High resolution

Image magnified x 2

High resolutionImage magnified x 2

Low resolution

JPG file size = 4,068

Image magnified x 4

To my eye, the first image is clearly superior. Pixelation is much less noticeable, and the color degradation resulting from the JPG chroma subsampling is much, much less severe. The stripes are red, as they should be, rather than the purple we see on the right. Some have suggested that a fairer comparison for viewing might be to do a bicubic resizing of the small image to match the dimensions of the larger image. Here is the result:



High resolution

JPG File size = 3,984 bytes



Low resolution

JPG file size = 4,068 bytes, then bicubic resized x 2. Low resolutionJPG file size = 4,068 bytes, then bicubic resized x 2.

and magnified x 2:



High resolution

JPG File size = 3,984

Image magnified x 2

High resolutionJPG File size = 3,984Image magnified x 2

Low resolution

JPG file size = 4,068, then bicubic resampled x 2.

Image magnified x 2. Low resolutionJPG file size = 4,068, then bicubic resampled x 2.Image magnified x 2.

The pixelation disappears if bicubic resizing is gone, but the image at right is clearly not nearly as detailed as the image at left. The red stripes are still purple, of course. Is it just a chroma subsampling problem? Most JPG compression implementations use chroma subsampling; that is, color information is stored at lower resolution than brightness information. This is a wise decision, as the human eye cannot resolve details of color as well as details of brightness. This chroma subsampling is the reason for the color shift in the red stripes above. In the smaller image, the stripe is so narrow that the whole stripe is wrongly reproduced. The color degradation disappears when chroma subsampling is not used. Digital camera makers do not give us the option of turning off chroma subsampling, as do a few graphics programs. Should they? Let's investigate. Martin Brown contributed comparison JPG images created without using chroma subsampling. He used "JPEG Optimizer" from xat.com to construct these images. (All digital cameras use chroma subsampline in their JPG compression.) Below is the set of comparisons constructed without chroma subsampling.



High resolution

File size = 3,984 bytes,

no chroma subsampling



Low resolution

File size = 4,068 bytes,

no chroma subsampling



High resolution

File size = 3,984 bytes

No chroma subsampling



Low resolution

File size = 4,068 bytes,

No chroma subsampling

Resized x 2 (bicubic)

Below are the above images magnified x 2.



High resolution

JPG File size = 3,984.

No chroma subsampling.

Image magnified x 2.





Low resolution.

JPG file size = 4,068.

No chroma subsampling.

Image resized x2 using bicubic resampling,

and then magnified x 2

JPG compression of the left image is beginning to produce the 8x8 blockiness that is seen in extreme JPG compression. The right images does not show these artifacts. However, the right image is blurry due to the bicubic resizing, and does not contain the detail that the left image does. I prefer the first image of each pair to the second, but may others prefer a blurry image to one with noticeable compression artifacts.

Of all the 4K renditions of the image, my favorite is the higher resolution image compressed with chroma subsampling. Here is a comparison of all this image to the above two:



High resolution

JPG File size = 3,984

No chroma subsampling

Image magnified x 2



High resolution

JPG File size = 3,984

Chroma subsampling

Image magnified x 2



Low resolution

JPG file size = 4,068

No chroma subsampling

Image resized x2 using bicubic resampling,

and then magnified x 2