PNG-spec icon indicating copy to clipboard operation
PNG-spec copied to clipboard

Some tone mapping requires the average luminance between frames

Open ProgramMax opened this issue 1 year ago • 10 comments

SMPTE ST 2094-10 requires the average luminance between frames in order to apply its tone mapping. Currently, this metadata is not provided in PNG.

(There is MaxFALL information, which is the maximum of the averages. But that is separate from the actual content average.)

If SMPTE ST 2094-10 is a tone mapping method we wish to support (which is likely), we will want a metadata chunk which carries this information.

ProgramMax avatar May 03 '23 17:05 ProgramMax

Is there an existing standard for metadata which provides this, or does the SMPTE spec expect it to be computed on-the-fly?

Also does it use actual luminance (computed from a weighted sum of linear-light rgb values) or is it a max of gamma-encoded rgb values?

svgeesus avatar May 13 '23 17:05 svgeesus

I assume the average luminance is supposed to be pre-computed and not on-the-fly. This is only an assumption. But it seems like on-the-fly would result in the tone mapping constantly adjusting and I don't recall any smoothing in SMPTE ST 2094-10. So it could have large jumps between frames.

I have no idea if it is gamma-encoded or linear-light. If I get another look at SMPTE ST 2094-10, I'll try to check.

ProgramMax avatar May 13 '23 20:05 ProgramMax

I assume a different average luminance value is only needed for animated PNG since MaxFALL value of one frame will be the same as the ST 2094-10 Average? ....since the MaxFALL of a still, single frame would be the Max.....

digitaltvguy avatar May 15 '23 16:05 digitaltvguy

Correct. Although, if SMPTE ST 2094-10 doesn't require MaxCLL, perhaps the cLLi chunk is a bit unwieldy even for single-frame PNGs.

ProgramMax avatar May 15 '23 18:05 ProgramMax

The average in ST 2094-10 is based on the average of code values, whereas MaxCLL is the average of linear light levels, so the two are not identical.

ST 2094-10 is not the only tone mapping algorithm, and we might wish to consider one that does not rely on the average, but only on min and max values -- which can be inferred from the ST 2086 metadata.

palemieux avatar May 15 '23 18:05 palemieux

It isn't within our power to choose which tone mapping method the client uses, right?

ProgramMax avatar May 15 '23 19:05 ProgramMax

I think we should recommend one.

See a few examples at https://www.sandflow.com/public/tone-mapping/.

palemieux avatar May 16 '23 15:05 palemieux

Should we add a reference white chunk instead of an average luminance? This defines the level for compositing in HDR Canvas also doesn't it?

digitaltvguy avatar May 18 '23 00:05 digitaltvguy

Should we add a reference white chunk instead of an average luminance?

I do not understand how this is useful and/or replaces MaxFALL ?

palemieux avatar May 18 '23 00:05 palemieux

It doesn't. It's in addition. Since China prefers a higher reference white, not documenting the reference white can cause an issue with tone-mapping (highlight compression would likely happen more aggressively above reference/graphic white). This is how the all single-master workflows work right now in live-linear broadcasts.

digitaltvguy avatar May 25 '23 16:05 digitaltvguy