Strange inexplicable banding
- 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:

As inputs, I'm using this DisplayP3 SDR image `input_sdr.jpg`:

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:

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:

Contributor guide
Assessment
This issue has not been assessed yet.