A7RV HEIF vs. JPEG

ProfHankD

Veteran Member
Messages
9,798
Solutions
32
Reaction score
6,251
Location
Lexington, KY, US
I have been noticing that HEIF doesn't really seem to be delivering quite as good shadow detail as JPEG on the Sony A7RV. It does produce better mid tones and highlights, for example, easily avoiding banding in the sky, but shadows seem to go featureless a bit early. Aside from the shadow details, I generally see fewer artifacts in HEIFs despite HEIF compressing to nearly half the size that JPEG manages. Of course, there are literally thousands of HEIF encoding options, so perhaps I'm just not picking wisely?

Anyway, here are some 1:1 example crops, all converted to DPReview-viewable JPGs using GIMP. In particular, observe the shadow details in the dark area left of the tree. First, a default JPEG:

DRO Off JPEG
DRO Off JPEG

Next, a default HEIF:

DRO Off HIF
DRO Off HIF

I don't see a lot of difference there. Now, let's turn on DRO (Dynamic Range Optimization) which is really quite good at holding shadow detail. First in JPEG:

DRO Lv4 JPEG
DRO Lv4 JPEG

And the HEIF:

DRO Lv4 HIF -- the best of both worlds?
DRO Lv4 HIF -- the best of both worlds?

I think DRO Lv4 helps both quite a lot. The DRO Auto setting didn't seem to have much impact on the HEIF over DRO Off, but Lv4 or Lv5 really saved a lot of shadow detail. To my view, a standard HEIF with DRO Lv4 might be the best alternative to JPEG DRO Auto. In shooting many scenes as DRO Lv4 HIF, I never saw anything having that artificial HDR look... which is sometimes a problem for DRO Lv4 JPEGs.

Some folks recommend shooting HEIF with a special Picture Profile, and this is where the A7RV offers too many options. The HLG3 profile (which isn't one of the 11 examples Sony provides by default) seems to be commonly recommended, so here's that:

HLG3 HIF
HLG3 HIF

Of course, DRO doesn't apply to Hybrid Log Gamma files. However, I don't really see HLG3 preserving shadow detail all that well, and mid tones are getting muddy.

So far, I'm thinking that no picture profile (which is also called PP2) with DRO Lv4 HEIF is the best alternative to my old standard of DRO Auto JPEG... and of course I also still have the raws if the HEIF isn't quite right. Incidentally, I was a bit surprised to see that default raw renderings by rawtherapee of raws captured as raw+HEIF with HLG3 and other picture profiles are somewhat altered by the different EXIF data placed in the raw for these modes.

What do folks think?

PS: If anyone cares, these were all shot using my old Tamron SP Macro 90mm f/2.5 52B at f/8... which is clearly not the weak link in the image quality here.
 
Last edited:
Thank you for the samples.

Would you mind sharing the original files for both JPEG and Heif? I am still thinking there is a conversion error happening. By applying/ assigning a REC709-A gamma curve to the files they match almost perfectly. So there is something not quite right going on.
 
Last edited:
I have been noticing that HEIF doesn't really seem to be delivering quite as good shadow detail as JPEG on the Sony A7RV. It does produce better mid tones and highlights, for example, easily avoiding banding in the sky, but shadows seem to go featureless a bit early.
This seems to be a test about profiles and contrast, more than looking at shadow detail and how close to the noise floor each file format will do a good job.

This is fine for judging out-of-camera results. But not really helpful if people are going to tweak their files a bit at post processing, digging for shadow detail.

Maybe a more informative approach for this would be to adjust the jpg and HEIF files to about the same brightness, contrast and color, and then look at the deep shadows?

Anyway, great examples and explanation. Thanks!
 
I have been noticing that HEIF doesn't really seem to be delivering quite as good shadow detail as JPEG on the Sony A7RV. It does produce better mid tones and highlights, for example, easily avoiding banding in the sky, but shadows seem to go featureless a bit early.
This seems to be a test about profiles and contrast, more than looking at shadow detail and how close to the noise floor each file format will do a good job.

This is fine for judging out-of-camera results. But not really helpful if people are going to tweak their files a bit at post processing, digging for shadow detail.
For me, the whole point of HEIF is to replace JPEG. In other words, I want a SOOC rendering that is directly usable for most purposes, with good contrast and a long tonal range and good detail preserved throughout the tonal range. That basically says I want localized tone mapping as used for HDR rendering, because we are going from 12-14 bit raw data to about 10 bit in HEIF.

DRO does a pretty good job of tone mapping for the shadow areas, but not so well for highlights, and the DRO Auto setting seems to be poorly calibrated for HEIFs -- it is less aggressive than it should be. HEIFs are clearly doing much better than JPEGs on the bright stuff. However, I'm becoming convinced that tonal quality of HEIF dark areas is worse than JPEGs (fewer values being used to encode the darkest stuff), so it actually needs more DRO-like boosting to preserve detail. DRO Level 4 or 5 seems to be the best answer for HEIFs, and they still look natural with that, whereas that's almost always too much for JPEGs. In fact, for HEIFs DRO could go higher than 5... if Sony gave that option.

Here's a simple example of a very high-contrast scene that the A7RV's DR can still handle pretty well. This was shot with DRO Auto -- before I realized that it isn't aggressive enough with HEIFs. Let's compare HEIF with an untweaked raw-to-JPEG conversion of the same capture:

DRO Auto HEIF of a very high-contrast scene
DRO Auto HEIF of a very high-contrast scene

JPEG rendered directly from the raw in the above raw+HEIF capture
JPEG rendered directly from the raw in the above raw+HEIF capture

Yeah, the JPEG image from raw is a little flat (it should be strongly tone mapped), but look at the shadow detail. DRO Auto on a JPEG would have kept most of the shadow detail that you see here behind the front tire of the first motorcycle, whereas the HEIF above doesn't have it no matter how hard I push... and, at the same time, the HEIF actually blew-out the highlights even on the buildings. Neither the dark details nor the building highlights are recoverable from the HEIF no matter how much I postprocess it.

To me, high-contrast scenes in HEIFs without high DRO look very punchy, but block up the shadows quite badly. To me, the above HEIF looks disturbingly like how Fuji cameras render Velvia JPEGs, a look that I deeply hate.

An HLG3 HEIF probably wouldn't lose either portion of the tonal scale for this scene, but it would dramatically reduce contrast so that recovering subtle tonal differences in the scene wouldn't be possible. In other words, tones look rather muddy even after postprocessing an HLG3 HEIF, and HLG3 HEIFs look way too flat to use as a JPEG replacement.
Maybe a more informative approach for this would be to adjust the jpg and HEIF files to about the same brightness, contrast and color, and then look at the deep shadows?
The whole point of JPEG or HEIF for me is that I do virtually no postprocessing. That's what I shoot raw+JPEG or raw+HEIF for.
Anyway, great examples and explanation. Thanks!
I'm not sure I've got this completely figured-out yet myself. Still, empirically, HEIF with a high DRO setting is looking like it is typically better than JPEG. It's just that HEIFs using any of the default or "example" settings are less reliable in producing an image that looks good without postprocessing.
 
Last edited:
Honestly, I think you are completely missing the point of an SDR Heif

The image out of the Heif pipeline should look exactly the same as the JPEG. You are not using any of the HDR metadata options here!

It should be comparable to rendering your image to 16bit Tiff instead of 8bit JPEG (obviously with 10bit and lossy compression), the image will look identical. You just gain a bit of detail, and a bit less posterization. But all colour and brightness values should remain unchanged.

Somehow your Heif is interpreted with the wrong gamma. Still not sure how that happens. But the format differences you are seeing are not format differences. They are just gamma mismatch
 
Honestly, I think you are completely missing the point of an SDR Heif

The image out of the Heif pipeline should look exactly the same as the JPEG. You are not using any of the HDR metadata options here!
Without DRO, the HEIFs are very similar to JPEGs... but not identical.
It should be comparable to rendering your image to 16bit Tiff instead of 8bit JPEG (obviously with 10bit and lossy compression), the image will look identical. You just gain a bit of detail, and a bit less posterization. But all colour and brightness values should remain unchanged.
Less posterization of mid and bright tones... apparently more posterization of dark tones. Posterization is a change of color and brightness. Incidentally, there's also visibly less frequency-domain artifacting in the HEIFs; the 8x8 DCT in JPEG encoding has never really been a good thing.
Somehow your Heif is interpreted with the wrong gamma. Still not sure how that happens. But the format differences you are seeing are not format differences. They are just gamma mismatch
There often is gamma mismatch even with JPEGs (not everything makes them with the same gamma curves), and I'd expect HEIFs to be more iffy, but I don't think that's the key issue here. The main problem I'm seeing has to do with DRO tone mapping. The DRO seems to be tuned for JPEG handling of DR, not the HEIF encoding of DR.

As for the HDR-oriented HEIFs, such as HLG3, I think they make no sense at all when doing raw+HEIF capture. They're all bad approximations to the postprocessing flexibility of even the lossy-compressed ARW raws.
 
Honestly, I think you are completely missing the point of an SDR Heif

The image out of the Heif pipeline should look exactly the same as the JPEG. You are not using any of the HDR metadata options here!
Without DRO, the HEIFs are very similar to JPEGs... but not identical.
It should be comparable to rendering your image to 16bit Tiff instead of 8bit JPEG (obviously with 10bit and lossy compression), the image will look identical. You just gain a bit of detail, and a bit less posterization. But all colour and brightness values should remain unchanged.
Less posterization of mid and bright tones... apparently more posterization of dark tones. Posterization is a change of color and brightness. Incidentally, there's also visibly less frequency-domain artifacting in the HEIFs; the 8x8 DCT in JPEG encoding has never really been a good thing.
Somehow your Heif is interpreted with the wrong gamma. Still not sure how that happens. But the format differences you are seeing are not format differences. They are just gamma mismatch
There often is gamma mismatch even with JPEGs (not everything makes them with the same gamma curves), and I'd expect HEIFs to be more iffy, but I don't think that's the key issue here.
The gamma mismatch is the problem here and it is the only problem. If you don't want to share any source files for whatever reason at least try the conversion with software that does not rely on your OS heif library.

For example the Sony converter?

Or try it on another OS? I am guessing you are using Mac OS, due to the REC-709A mismatch?

But confirmation by me or another third party that it is not your conversion would be easiest. Then at least you know your system is displaying heifs correctly.
The main problem I'm seeing has to do with DRO tone mapping. The DRO seems to be tuned for JPEG handling of DR, not the HEIF encoding of DR.
My assumption is DRO works exactly the same on both files. DRO lifts the shadows, and then the wrong gamma crushes them to black. This is why you seem to see only DR4 and 5 working. But those are just the only ones strong enough to escape the gamma crush
As for the HDR-oriented HEIFs, such as HLG3, I think they make no sense at all when doing raw+HEIF capture. They're all bad approximations to the postprocessing flexibility of even the lossy-compressed ARW raws.
 
But confirmation by me or another third party that it is not your conversion would be easiest. Then at least you know your system is displaying heifs correctly.
The HEIF of the motorcycles is http://aggregate.org/IMG/DSC01037.HIF

Good luck getting either the shadows or highlights out of that...
... My assumption is DRO works exactly the same on both files. DRO lifts the shadows, and then the wrong gamma crushes them to black. This is why you seem to see only DR4 and 5 working. But those are just the only ones strong enough to escape the gamma crush
I'm using GIMP 16-bit. It seems unlikely it can't get 10 bits of DR encoded in 16 bits of working space.

I suspect DRO is basically lifting only in the bottom shades, which in 10-bit HEIFs have fewer values used to encode them, thus seriously posterizing when encoded. Please do prove me wrong about that... it's a very discouraging observation.
 
But confirmation by me or another third party that it is not your conversion would be easiest. Then at least you know your system is displaying heifs correctly.
The HEIF of the motorcycles is http://aggregate.org/IMG/DSC01037.HIF

Good luck getting either the shadows or highlights out of that...
This is the image just opened in Gimp and saved as JPEG.

No gamma correction

No shadow lift

Just open and saved. And you can see significantly more shadow detail. Your Heif library seems to be broken.

View attachment 9a35855241c24441b7f0cbb860e4c792.jpg

... My assumption is DRO works exactly the same on both files. DRO lifts the shadows, and then the wrong gamma crushes them to black. This is why you seem to see only DR4 and 5 working. But those are just the only ones strong enough to escape the gamma crush
I'm using GIMP 16-bit. It seems unlikely it can't get 10 bits of DR encoded in 16 bits of working space.

I suspect DRO is basically lifting only in the bottom shades, which in 10-bit HEIFs have fewer values used to encode them, thus seriously posterizing when encoded. Please do prove me wrong about that... it's a very discouraging observation.
Seems like its just your heif viewer
 
But confirmation by me or another third party that it is not your conversion would be easiest. Then at least you know your system is displaying heifs correctly.
The HEIF of the motorcycles is http://aggregate.org/IMG/DSC01037.HIF

Good luck getting either the shadows or highlights out of that...
This is the image just opened in Gimp and saved as JPEG.

No gamma correction

No shadow lift

Just open and saved. And you can see significantly more shadow detail. Your Heif library seems to be broken.

View attachment 9a35855241c24441b7f0cbb860e4c792.jpg
That looks slightly different from the one I posted, but still blown out highlights and with detail in the shadows gone. With JPEGs, DRO Auto generally does better.
... My assumption is DRO works exactly the same on both files. DRO lifts the shadows, and then the wrong gamma crushes them to black. This is why you seem to see only DR4 and 5 working. But those are just the only ones strong enough to escape the gamma crush
I'm using GIMP 16-bit. It seems unlikely it can't get 10 bits of DR encoded in 16 bits of working space.

I suspect DRO is basically lifting only in the bottom shades, which in 10-bit HEIFs have fewer values used to encode them, thus seriously posterizing when encoded. Please do prove me wrong about that... it's a very discouraging observation.
Seems like its just your heif viewer
I don't see that at all -- your image might be a hair better than the HEIF-to-JPEG I got, but still has the big DRO failure.

What HEIF conversion tool are you using with GIMP?

I have the standard Ubuntu HEIF support enabled.
 
But confirmation by me or another third party that it is not your conversion would be easiest. Then at least you know your system is displaying heifs correctly.
The HEIF of the motorcycles is http://aggregate.org/IMG/DSC01037.HIF

Good luck getting either the shadows or highlights out of that...
This is the image just opened in Gimp and saved as JPEG.

No gamma correction

No shadow lift

Just open and saved. And you can see significantly more shadow detail. Your Heif library seems to be broken.

View attachment 9a35855241c24441b7f0cbb860e4c792.jpg
That looks slightly different from the one I posted, but still blown out highlights and with detail in the shadows gone. With JPEGs, DRO Auto generally does better
? The grill of the bike has way more detail than the black block you uploaded. You can see the vertical lines in the cooling fins. Flip back and forth between the images a bit. Here it is with lifted shadows in post:



fc40fd1065f94cd899e257f438e5cbe2.jpg

.
... My assumption is DRO works exactly the same on both files. DRO lifts the shadows, and then the wrong gamma crushes them to black. This is why you seem to see only DR4 and 5 working. But those are just the only ones strong enough to escape the gamma crush
I'm using GIMP 16-bit. It seems unlikely it can't get 10 bits of DR encoded in 16 bits of working space.

I suspect DRO is basically lifting only in the bottom shades, which in 10-bit HEIFs have fewer values used to encode them, thus seriously posterizing when encoded. Please do prove me wrong about that... it's a very discouraging observation.
Seems like its just your heif viewer
I don't see that at all -- your image might be a hair better than the HEIF-to-JPEG I got, but still has the big DRO failure.
DRO is on Auto. Without a comparison JPEG I would honestly say the JPEG will look exactly the same
What HEIF conversion tool are you using with GIMP?
Whatever gimp uses by default on Windows
I have the standard Ubuntu HEIF support enabled.
 

Keyboard shortcuts

Back
Top