If I would like to convert hdr images to sdr, what values would be changed in the image data. So far i think ive understood that the bit depth has to be changed so for example from 12 bit to 8 bit you would divide by 16 (4096/256=16) and round up or down to quantasize the value. But is that it? Does luminance or chrominance or any other property of the image have to be changed? I think i found one source that said gamma stays the same at 2.4 while another source said that the gamma curve changes to better fit the extreme values. When i google this problem all i find are these functions used to tonemap the images but i cant find anything about how to use them.
Normal HDR still images are using special transfer functions, either PQ or HLG. That is what HDR is, a new transfer function. 2.4 gamma is what is BT.1886 on perfect OLED display is for SDR transfer (same in BT.601, BT.709, BT.2020, only BT.2100 introduced PQ and HLG).
To convert to SDR you need to besides the obvious change of PQ transfer to sRGB or BT.1886
a) change BT.2020 primaries to BT.709 primaries, b) remove the matrix of BT.2020-ncl and change to full range bt.601 matrix in case of JPEG or change to R'G'B'.