What is Radiance HDR?

Radiance HDR is a high-dynamic-range image format developed for the Radiance rendering system and commonly identified by the HDR extension. Its common RGBE pixel encoding represents each pixel with three color bytes and one shared-exponent byte.

How Radiance HDR works

A Radiance picture has three parts: a text information header, a resolution string, and scanline records. The header typically starts with #?RADIANCE (stb_image and ImageMagick also accept #?RGBE), holds variable assignments such as FORMAT (either 32-bit_rle_rgbe or 32-bit_rle_xyze), EXPOSURE, COLORCORR, and PRIMARIES, and ends with an empty line. The resolution string, for example -Y 1024 +X 2048, gives the pixel counts and the order in which pixels were written. Each pixel takes four bytes: an 8-bit mantissa for each of three primaries and a common 8-bit exponent. A mantissa byte is a fraction of 256, not a whole-number value: Radiance’s reference code decodes a channel as (mantissa + 0.5) / 256 × 2^(exponent − 128), and an exponent byte of 0 means black, so the bytes (128, 64, 32, 129) store about (1, 0.5, 0.25). Scanlines are stored uncompressed or with one of two run-length schemes; the Radiance reference puts typical compression at about 2:1. Values are linear and can be physical: for RGB data, a pixel of (1,1,1) corresponds to 1 watt per steradian per square meter over the visible spectrum, but the Radiance reference says the values are not physically valid if light sources were not properly modeled, the picture was converted from another format, or custom filtering was applied. Radiance’s own documentation uses the .pic suffix; .hdr is the common one elsewhere.

Key facts

  1. RGBE gives each pixel one 8-bit mantissa per channel and a single shared exponent, not three floating-point numbers. In a nonblack pixel the brightest channel’s mantissa byte is between 128 and 255 and the other two are scaled by the same exponent, so a channel far dimmer than the brightest keeps few significant bits. The format’s author puts accuracy at about 1% over more than 76 orders of magnitude and notes that step sizes can become visible in saturated blue and magenta regions.
  2. The resolution string carries scan order as well as size. -Y N +X M is the standard form: N rows stored top to bottom, each with M pixels left to right. Seven other sign and axis combinations describe flipped or rotated storage, and when X comes first the first number is the width, not the height. A decoder that extracts only two numbers transposes or flips such files; the Radiance reference notes that some programs handle only the standard ordering.
  3. All four bytes are used by the three mantissas and the exponent, so there is no alpha channel and no sign. Transparency has to travel in a separate file or another format, and RGBE cannot store negative components, which limits it to colors inside the gamut of its RGB primaries. The XYZE variant, declared by FORMAT=32-bit_rle_xyze, covers the visible gamut, but a reader must check the FORMAT line to tell the two apart, so confirm XYZE support before relying on it.
  4. Header variables change what the numbers mean. EXPOSURE is a multiplier already applied to the pixels and is cumulative, so original radiance is the stored value divided by the product of all EXPOSURE lines. COLORCORR is the same kind of applied, cumulative multiplier given separately for each primary, so each channel must also be divided by its COLORCORR product. PRIMARIES gives the chromaticities; when it is absent, Radiance’s defaults apply, and their white point is equal-energy (0.333, 0.333), not D65. Some readers do not use these: OpenImageIO’s documentation says it assumes every RGBE file is linear with sRGB primaries.

When Radiance HDR matters

Use Radiance HDR when a renderer or lighting tool expects .hdr input, most often for environment maps and image-based lighting that need linear values well beyond display white. OpenImageIO’s documentation says the format is still used for many legacy applications and to distribute HDR environment maps, but it recommends newer formats such as OpenEXR except where legacy file access is required. When converting, check that the destination honors the header’s exposure, color correction, primaries, and orientation; an 8-bit output cannot keep the extra range.

How Transloadit helps with Radiance HDR

Transloadit’s image formats table lists HDR, described as the Radiance RGBE image format, as a format its ImageMagick-based Robots, including /image/resize, can read and write.

The table reports read and write capability only; it does not describe how high-dynamic-range values are mapped when the output is an 8-bit format such as JPEG or PNG, so check brightness and color on a representative file.

Explore Transloadit’s file formats & compression capabilities

Sources

Turn media knowledge into a working pipeline

Connect uploads, processing, AI, storage, and delivery through one declarative API — with the encoding stack, scaling, and format churn handled for you.

Try Transloadit for free