Magic Lantern Forum

General Discussion => General Chat => Topic started by: GiamBoscaro on October 03, 2019, 04:35:38 PM

Title: How to correctly calculate the Dynamic Range of an image
Post by: GiamBoscaro on October 03, 2019, 04:35:38 PM
I'm trying to compare the dynamic range of a correctly exposed LDR picture with the dynamic range of the HDR image obtained with 3 LDR pictures.

Right now I'm calculating the DR as:

stops = log2(max) - log2(min);

Where

max = maximum pixel value found in the image
min = minimum pixel value found in the image

The reference correctly exposed image is an 8 bits Jpeg, so the dynamic range is always 8 stops, since the values goes from 0 to 255. The HDR image is an RGBe radiance map, so the values are 32 bits floating point.

I was wondering a few things:

Is this the correct way to calculate the dynamic range from a picture?
All jpg files have pixel values from 0 to 255, so every correctly exposed jpg will have the same dynamic range. Is this right?
Sometimes the calculated dynamic range of the HDR image is lower than the original. How is this possible?
Thank you for your help
Title: Re: How to correctly calculate the Dynamic Range of an image
Post by: garry23 on October 04, 2019, 10:32:02 AM
Always worth reading here

http://www.photonstophotos.net/GeneralTopics/Sensors_&_Raw/Sensor_Analysis_Primer/Photographic_Dynamic_Range_Summary.htm

and here

https://clarkvision.com/articles/index.html
Title: Re: How to correctly calculate the Dynamic Range of an image
Post by: Sapporo on October 05, 2019, 03:28:43 PM
Not really the answer but this may also help https://www.fredmiranda.com/forum/topic/1611318/2#14966174