# What is exposure, anyway?

**URL:** <https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807>\
**Category:** hdri\
**Created:** [January 18, 2022, 10:53pm UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807 "2022-01-18T22:53:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathaniel\_Jones](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/nathaniel_jones/32/603_2.png) [@Nathaniel\_Jones](https://discourse.radiance-online.org/u/Nathaniel_Jones)\
**Post date:** [January 18, 2022, 10:53pm UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/1 "2022-01-18T22:53:46Z")

</div>

I’m asking what I fear may be a very basic question. I just took several series of exposure bracketed images, all with the same manual camera settings, same list of shutter speeds, etc., under different lighting conditions, and converted them to HDR using `hdrgen`. I expected the output HDR file to all have the same header information. However, when I call `getinfo` on the HDR files, they all have slightly different exposure values, and the exposure values also change if I cull overexposed JPG files before running `hdrgen`. So what is the exposure value, and how is it meant to be used?

And a side question, does anyone have documentation for the `hdrgen` command-line arguments?

Thanks!

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [January 19, 2022, 12:21am UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/2 "2022-01-19T00:21:15Z")

</div>

Hi Nathaniel,

In general, hdrgen should create the same header EXPOSURE= line for identically-exposed input images, provided nothing (ISO, speed, aperture) changes for the two exposure sets, and the -x option is not used. (See man page [here](http://www.anyhere.com/gward/pickup/hdrgen.htm) for options.)

Did you check that your camera does not automatically adjust the ISO setting? Some do, even in manual mode, and this is something to avoid. You can double-check the settings used either with Photoshop, or Preview, or exiftool.

Hdrgen takes the settings from the central exposure in a sequence, and uses this to determine the final multiplier for the HDR output. You can of course adjust the exposure subsequently to match them to each other if need be.

Hope this helps!  
-Greg

---

<div class="post-metadata">

**Author:** ![Nathaniel\_Jones](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/nathaniel_jones/32/603_2.png) [@Nathaniel\_Jones](https://discourse.radiance-online.org/u/Nathaniel_Jones)\
**Post date:** [February 17, 2022, 5:25pm UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/3 "2022-02-17T17:25:29Z")

</div>

Hi Greg,

That generally makes sense. So should the raw RGBE values stored in the HDR file be multiplied by the exposure value to obtain the radiance value at each pixel? Does exposure have some units to it, or is it unitless?

I also noticed that when I use `pfilt` to shrink the image (by a factor of 8 in each dimension), `pfilt` appends a new exposure value to the HDR file header, which is about two orders of magnitude greater than the exposure value calculated by `hdrgen`. Why is this?

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [February 17, 2022, 6:03pm UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/4 "2022-02-17T18:03:42Z")

</div>

Hi Nathaniel,

The exposure multipliers are unitless. All left-justified EXPOSURE= lines in the header should be multiplied together to get the actual exposure that was applied to the image subsequent to absolute calibration / rendering. With no exposure, the floating-point RGB values in a radiance (lower case) image should be in watts/sr/meter^2 averaged over some waveband. If you have a conversion to luminance (e.g., the standard is .265R + .670G + .065B in Radiance), then this value, multiplied by 179 lumens/watt and divided by the cumulative exposure, gets you to absolute candelas/meter^2.

Cameras tend to use CCIR-709 primaries, whose conversion works out to:

```auto
Luminance = (.213*R + .715*G + .072*B)*179/(product_of_exposures)

```

An important caveat is that XYZE picture files, as produced by ra\_xyze, do not need the 179 lumens/watt conversion factor.

Your pfilt command was probably without a -1 option, so it calculated an exposure over the image to get pixel values to average to 0.5. This new exposure when multiplied by the original EXPOSURE= line gives you a combined exposure for calibration.

This is all rather more complicated than it should be, mostly for historical reasons. Newer HDR formats use a “sample-to-nits” conversion factor stored in metadata in place of the cumulative EXPOSURE= lines.

Hope this helps!  
-Greg

---

<div class="post-metadata">

**Author:** ![Nathaniel\_Jones](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/nathaniel_jones/32/603_2.png) [@Nathaniel\_Jones](https://discourse.radiance-online.org/u/Nathaniel_Jones)\
**Post date:** [March 4, 2022, 9:25pm UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/5 "2022-03-04T21:25:26Z")

</div>

Hi @Greg_Ward,

This is all very helpful, thanks. I’m experimenting with a new camera, and whatever calibration it has built into it allows me to make HDR files with `hdrgen` that come very close to measured luminance levels. However, I’ve noticed that the camera response function generated by `hdrgen` comes out slightly different every time. Sometimes it generates 4 coefficients per channel, sometimes 3.

1. Am I right to understand that a line like `3 1.08609 -0.464786 0.379661 -0.000969182` in the response file indicates `1.08609*x^3 - 0.464786*x^2 + 0.379661*x - 0.000969182`?
2. To get a response file that I can apply broadly, what is the ideal scene to feed `hdrgen`?

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [March 5, 2022, 3:00am UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/6 "2022-03-05T03:00:56Z")

</div>

Hi Nathaniel,

hdrgen should be used once to generate a good calibration, then this file should be re-used if possible. It can be a polygon of order 2, 3, 4, or 5, and it will vary for different inputs. Your interpretation of the coefficients is correct. They always add to 1, but you can multiply the coefficients by a constant to get a more exact absolute calibration for a particular camera. Here’s a tip from the file “quickstart\_pf.txt” that accompanies Photosphere on how to set up a scene for HDR calibration:

1. To create a high dynamic-range image, you need to start with  
a set of “bracketed” exposures of a static scene. It is best if  
you take a series of 10 or more exposures of an interior scene looking  
out a window and containing some large, smooth gradients both inside  
and outside, to determine the camera’s natural response function.  
Be sure to fix the camera white balance so it doesn’t change, and  
use aperture-priority or manual exposure mode to ensure that only  
the speed is changing from one exposure to the next. For calibration,  
you should place your camera on a tripod, and take your exposure series  
starting from the longest shutter time and working to the shortest in  
one-stop increments. Once you have created your image series,  
load it into Photosphere directly – DO NOT PROCESS THE IMAGES  
WITH PHOTOSHOP or any other program. Select the thumbnails,  
then go to the “File → Make HDR…” menu. Check the box that says  
“Save New Response”, and click “OK”. The HDR building process  
should take a few minutes, and Photosphere will record the computed  
response function for your camera into its preferences file, which  
will save time and the risk of error in subsequent HDR images.  
You will also have the option of setting an absolute calibration  
for the camera if you have a measured luminance value in the scene.  
This option is provided by the “Apply” button submenu when the  
measured area is selected in the image. (Click and drag to select.)  
Once an HDR image has been computed, it is stored as a temporary  
file in 96-bit floating-point TIFF format. This file is quite  
large, but the data will only be saved in this format if you  
select maximum quality and save as TIFF. Otherwise, the 32-bit  
LogLuv TIFF format will be preferred (or the 24-bit LogLuv format  
if you set quality to minimum). You also have the option of saving  
to the more common Radiance file format (a.k.a. HDR format), or  
ILM’s 48-bit OpenEXR format. The newest format supported is an  
extended JPEG, that takes just a little more space than a standard  
JPEG and retains all the HDR information. If you choose not to save  
the image in high dynamic-range, the tone-mapped display image can be  
written out as a 24-bit TIFF or a standard JPEG image.

---

<div class="post-metadata">

**Author:** ![Nathaniel\_Jones](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/nathaniel_jones/32/603_2.png) [@Nathaniel\_Jones](https://discourse.radiance-online.org/u/Nathaniel_Jones)\
**Post date:** [December 25, 2023, 9:38pm UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/7 "2023-12-25T21:38:45Z")

</div>

Continuing the exposure question with some further confusion, I’ve been experimenting with using FreeImage to manipulate HDR files, and found that it ignores the EXPOSURE= line when reading the HDR files and writes EXPOSURE=0 when writing them. Is EXPOSURE=0 legal? I expected that other Radiance programs would get upset if I fed them an HDR image with EXPOSURE=0, but most do not. However, `pfilt` warns me “picture too dark or too bright.”

Edit: It looks like someone has reported this as a [bug](https://github.com/imageio/imageio/issues/421) in FreeImage, but the update isn’t available for Python yet.

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [December 26, 2023, 12:28am UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/8 "2023-12-26T00:28:12Z")

</div>

On utilities like pcomb, pvalue, rmtxop, and the new rcomb commmand, EXPOSURE=0 may cause divide-by-zero warnings and deliver black images with some option settings. So no, it’s not legal, and I’m not sure why they chose that as the default.

You can override it with “getinfo -r” to remove or replace it with a different value. The EXPOSURE setting is the scale factor from a calibrated radiance/irradiance value to whatever values are in the image.

-G

---

<div class="post-metadata">

**Author:** ![Guanzhou\_Ji](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@Guanzhou\_Ji](https://discourse.radiance-online.org/u/Guanzhou_Ji)\
**Post date:** [January 23, 2024, 3:05am UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/9 "2024-01-23T03:05:09Z")

</div>

Hi Greg,

This topic is very useful.

I have a question for ‘product\_of\_exposures’ when I read this post.  
Let’s say I have five 5 images (Shutter Speed: 4, 1, 1/4  
1/15, 1/60) to be merged into a single HDR, then R, G, and B values are known.  
I plan to compute luminance on my own. How to get ‘product\_of\_exposures’?

My hypothesis is it requires some conversion with other camera settings.

Thanks,

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [January 23, 2024, 4:37pm UTC](https://discourse.radiance-online.org/t/what-is-exposure-anyway/5807/10 "2024-01-23T16:37:44Z")

</div>

I can refer you to this very old post from the original Radiance website:

[filmspeed.html — Radsite](https://www.radiance-online.org/archived/radsite/radiance/refer/Notes/filmspeed.html)

Cheers,  
-Greg
