google / google/libultrahdr

Strange inexplicable banding

Open
#357 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
344
Forks
67
Avg merge
15d 2h
Merged PRs (30d)
7

Description

I am trying to make an ultrahdr jpeg version of this test image:
![Image](https://github.com/user-attachments/assets/cd3b1336-d888-4bdd-8901-3f6155ed8b66)

As inputs, I'm using this DisplayP3 SDR image `input_sdr.jpg`:
![Image](https://github.com/user-attachments/assets/8f355b85-2df2-46df-92e3-2b1039d711c8)

and this P3 PQ version of the original HDR image, `ITU-R_BT.2111-2-Test_pattern_PQ_full_range.png.raw`:

[ITU-R_BT.2111-2-Test_pattern_PQ_full_range.png.raw.zip](https://github.com/user-attachments/files/19958325/ITU-R_BT.2111-2-Test_pattern_PQ_full_range.png.raw.zip)

Then I run this command line:
```
ultrahdr_app -m 0 -a 5 -t 2 -C 1 -w 1920 -h 1080 -c 1 -R 1 -s 1 -Q 95 -M 1 -L 2000 -p ITU-R_BT.2111-2-Test_pattern_PQ_full_range.png.raw -i input_sdr.jpg -z output_ultrahdr.jpg
```

The result I get is this:

![Image](https://github.com/user-attachments/assets/f8de07e8-804e-4257-bb60-e468a7a347ee)

The colors seem to be more or less correct, but there are strange noticeable elliptical banding patterns in the solid color regions and I don't understand what is causing that. I would expect regions of solid color to remain flat.

Is there something in the computation of the gain map from the SDR base and the HDR alternate images that is not just a per-pixel thing and that could introduce this kind of banding?

On photographic images I am also getting banding artifacts in the skies that seem like they should be avoidable, for example:

![Image](https://github.com/user-attachments/assets/22db93b5-3430-4509-964c-98247d0a7602)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.