Radiance High Dynamic Range image file
application/octet-stream
Magic Bytes
Offset: 0
23 3F 52 41 44 49 41 4E 43 45 0A
The Radiance HDR format is a high-dynamic-range imaging standard originally developed by Greg Ward for the Radiance lighting simulation system. It utilizes a specialized RGBE encoding scheme to capture a vast range of brightness values, making it essential for environment mapping and realistic lighting in computer graphics. While critical for professional 3D visualization workflows to preserve luminance data, the format is inherently safe as it stores simple raster information without support for embedded scripts.
Validation Code
How to validate .hdr files in Python
Python
def is_hdr(file_path: str) -> bool:
"""Check if file is a valid HDR by magic bytes."""
signature = bytes([0x23, 0x3F, 0x52, 0x41, 0x44, 0x49, 0x41, 0x4E, 0x43, 0x45, 0x0A])
with open(file_path, "rb") as f:
return f.read(11) == signature
How to validate .hdr files in Node.js
Node.js
function isHDR(buffer: Buffer): boolean {
const signature = Buffer.from([0x23, 0x3F, 0x52, 0x41, 0x44, 0x49, 0x41, 0x4E, 0x43, 0x45, 0x0A]);
return buffer.subarray(0, 11).equals(signature);
}
Go
func IsHDR(data []byte) bool {
signature := []byte{0x23, 0x3F, 0x52, 0x41, 0x44, 0x49, 0x41, 0x4E, 0x43, 0x45, 0x0A}
if len(data) < 11 {
return false
}
return bytes.Equal(data[:11], signature)
}
API Endpoint
GET
/api/v1/hdr
curl https://filesignature.org/api/v1/hdr