DPReview.com is closing April 10th - Find out more

Impact of Noise and DoF on JPG File Size

Started Sep 20, 2021 | Discussions
DJMusic Senior Member • Posts: 1,312
Impact of Noise and DoF on JPG File Size

I recently did some tests in response to a question on a Facebook group. The question was around JPG files for the D780 that were considerably smaller than their D750 counterparts--same lens, same file size/quality, etc. After I switched to DxO PureRaw, I noticed that the JPGs were considerably smaller, though the images were still quite sharp. This got me thinking about the affect 1) depth of field (DoF) and 2) noise had on a JPG file.

For this test, I shot three scenes at F 2.8, 5.6, 8.0 and 16.0 on my D780. I shot at raw + fine JPG to have a straight-out-of-camera (SOOC) image as a control. I processed the raw files in Lightroom (quality of 85), auto adjustments only. One pass was straight from the Nikon raw file, the other from a dng file processed through DxO Pure Raw. The images were shot in the sun so noise was already low. Full disclosure, I was not on a tripod, so a bit of the variation comes from slightly different framing.

While a lot depends on the complexity of the image, there was a consistent theme--both DoF and the amount of noise in an image makes a difference in the size of a JPG file. And that makes sense because it's more data to store. Detail or noise, it still takes up space. DoF differences are seen in the same line (e.g. between SOOC f2.8 and F5.6). Differences in noise levels are between the types of processing (e.g. between SOOC F2.8 and NEF F2.8). To be clear, the noise would probably not be immediately visible without "pixel peeping", so this isn't primarily a question of image quality, just file size.

A table with the results is linked below, along with the images divided into folders. The numbers in the table are the file sizes in MBs. I have put the % change between the various aperture values and the JPG files. I have found that there is no visible loss in quality overall.

This was a fun bit of experimenting. Hope it's interesting and/or helpful.

https://1drv.ms/u/s!AmoZSoV3yh1shtR_s7pTDntWaoQ_kA?e=1R5y1j

 DJMusic's gear list:DJMusic's gear list
Nikon D7200 Nikon D780 Nikon AF Nikkor 50mm f/1.8D Tamron SP 24-70mm F2.8 Di VC USD Tamron SP 150-600mm F5-6.3 Di VC USD +6 more
Nikon D750
If you believe there are incorrect tags, please send us this post using our feedback form.
Tom Axford Forum Pro • Posts: 10,067
Re: Impact of Noise and DoF on JPG File Size
1

JPEG file sizes are very sensitive to the JPEG quality setting, but also to the amount of fine detail in the file.

This image has a file size of 5.1MB at 91% quality setting because it has lots of fine detail.

Original image at 91% JPEG quality is 5.1MB

If I apply a gaussian blur to the image (radius 2.5), then the image size drops to 2.0MB.

Blurred image at 91% JPEG quality is 2.0MB

Original image at 34% JPEG quality is 1.9MB

ProfHankD
ProfHankD Veteran Member • Posts: 9,147
Quick overview of JPEG encoding
3

DJMusic wrote:

I recently did some tests in response to a question on a Facebook group. The question was around JPG files for the D780 that were considerably smaller than their D750 counterparts--same lens, same file size/quality, etc. After I switched to DxO PureRaw, I noticed that the JPGs were considerably smaller, though the images were still quite sharp. This got me thinking about the affect 1) depth of field (DoF) and 2) noise had on a JPG file.

JPEG compression has several key components:

1. Remapping to YUV space from RGB.

2. Removal of much of the U and V precision (maintaining luminance, limiting color).

3. DCT (Discrete Cosine Transform -- frequency domain) on 8x8 pixel blocks.

4. Lossless compression of the results.

1 & 2 are relatively harmless except in that JPEGs will not preserve color edges that are not also luminance edges. 3 & 4 do not handle random noise well. Most JPEG artifacts really come from 3; the DCT is great for compressing regular patterns, but even representing a solid-color 8x8 patch is problematic, and those little square box artifacts seen at high-contrast edges are basically 8x8 DCT artifacts. Blurring or lesser DoF basically reduce the range of frequencies within each 8x8 block, making the DCT more efficient. Incidentally, higher-resolution image of natural scenes tend to compress better then lower-resolution images of the same scene because the frequency domain variance in an 8x8 block tends to be less, which is why 42MP images are often far less than 2X the size of 24MP ones.

Here's an old (but still valid) comparison of how the JPEG quality settings work:

Basically, 100% quality JPEG is far from lossless, but things don't really get blurry at low quality settings. Aside from discarding more color information at lower quality settings, the DCT compression basically just restricts the frequency domain variation within an 8x8 block: you get regular patterns, not exactly blur.

The interesting result of this is that lower quality setting on a higher resolution image often produce a sharper, yet smaller file. For example, setting your camera to do low-quality full resolution JPEG encoding is probably smarter than setting it to do high-quality compression with a lower pixel count. As a simple example, here's a 16,309-byte 128x128 JPEG at 100% quality:

and here's the same image taking just 9,025 bytes as a 256x256 JPEG at 50% quality:

Yes, the smaller file is higher resolution and sharper!

BTW, here I'm talking about 1990s-style JPEGs... which unfortunately is what almost all cameras and software use. The JPEG2000 standard does much better, but it's very different internally, and the old-style JPEG algorithms are embedded in a lot of hardware, so it's a pain to switch. For example, most cameras have hardware JPEG encoders.

 ProfHankD's gear list:ProfHankD's gear list
Canon PowerShot SX530 Olympus TG-860 Sony a7R II Canon EOS 5D Mark IV Sony a6500 +32 more
EduardoP2021
EduardoP2021 Forum Member • Posts: 64
Re: Impact of Noise and DoF on JPG File Size
1

For me, both DoF and the amount of noise in an image makes a difference in the size of a JPG file

-- hide signature --

All is save tiktok possible

Keyboard shortcuts:
FForum MMy threads