HDR formats
Imaging & Randering
HDR vs. LDR
• HDR
• Scene referred standard
1/10/2010
• Tone mapping
• Usefull for:
• Many different output devices
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Postprocessing
• LDR
• Output referred standard
• sRGB
• 1,6 ordes of magnitude
• Don‘t cover visible gamut
2
History
• 1850 Gustav Le Gray combined negatives
• 1940‘s Charles Wyckoff Picture of nuclear explosion
1/10/2010
• 1980‘s Film industry proprietary use
• 1985 First HDR format by Gregory Ward Radiance
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• 1997 Paul Devebec recovering HDR from photograps
• 1997 The Campanile movie
• First image editing program: HDRShop lead by Paul Devebec
• 2004 Valve Software used HDR rendering in Half life 2
3
Uncompressed vs Lossy &
Lossless compression
• Each format is Lossy
• Thery is only precision or implementation errors
1/10/2010
• Uncompressed formats
• PFM
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Lossless compression formats
• OpenEXR
• Radiance
• LogLuv Tiff
• Lossy compresion formats
• OpenEXR (Pixar‘s compression)
• Future interest
4
Logarithmic vs. Linear
& Gamma encoding
• Logarithmic...
• Linear...
1/10/2010
• Logarithmic examples
• LogLuv TIFF
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Pixar‘s TIFF
• Lograithmic exp. examlples
• Radiance
• PFM
• Linear examples
• scRGB
• Gamma correction
5
• sRGB
Colorspaces
• XYZ
• CIE standard
• Unreal primaries
1/10/2010
• RGB
• Negative primaries
• sRGB
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Gamma correction
• Luv
• Luminiscence
• u‘,v‘ vectors
• Convertible to XYZ
• YCC
• Y luminiscence
• Cr Cb correction
• Convertible to RGB 6
Magnitude & precision
• Magnitude is 10 based logarithm of delta max value/min value
• sRGB has 1,6 orders of magnitude
1/10/2010
• Human eye can see about 4 orders of magnitude at one time
• Possible magnitude is about 62 orders of magnitude
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Precision is size of quantitization step in current magnitude
• reasonable precision is about 1%
• Human can detect 2%, but in darker regions about 5%
• Gama&Linear encoding don‘t have the same precision over it‘s
magnitude
7
Gamut
• Spectrum of colors
• Visible gamut: Human visible spectrum of colors
1/10/2010
• Colorspace covers gamut
• XYZ
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• sRGB with sign
• Colorospace don‘t cover gamut
• sRGB
8
Comparison – table
By Tomáš Masařík for
1/10/2010
9
Počítačová Grafika I. at MFF UK
Comparison – magnitudes/bits
By Tomáš Masařík for
1/10/2010
10
Počítačová Grafika I. at MFF UK
By Tomáš Masařík for
1/10/2010
11
Počítačová Grafika I. at MFF UK
Tagged Image File Format
(.tif, .tiff)
• Aldus
• Adobe Systems since 2009
1/10/2010
• TIFF 6.0
• TIFF/EP, TIFF/IP, GeoTIFF
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Part of Exchangeable image file format (Exif)
• Tag file format container (wrapper)
• LibTIFF by Sam Lefflare
• Scanners, Printers, Fax
12
RAW
• Special unprocessed format of Digital camera
• No common specification – based on chipset of a camera
1/10/2010
• About 4 orders of magnitude (depends on type of camera)
• Nonlineary image data!
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
13
Radiance (.pic, .hdr)
• Gregory Ward (1985)
• 4 byte per pixel (R_mantisa, G_mantisa, B_mantisa,
1/10/2010
shared_exponent)
• 76 orders of magnitude 1% of relative accuracy
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• uncompressed vs. (standart or adaptive) run lenght encoding
• Header, resolution string, pixel data
• The oldest and the most popular format
• XYZE covers gamut, RGBE don‘t
14
Radiance - header
• Magic: „#?RADIANCE“
• Keywords ended by empty line
1/10/2010
• Format (RGBE vs. XYZE)
• Exposure
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Color corection
• Software version
• ...
15
Radiance - resolution string
• Inline string
• 4 values
1/10/2010
• Resolution X & Y
• In integer (N)
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Flipping & Rotation (sign)
• Example
• -Y N +X N
16
Portable float map (.pfm)
• Paul Devebec
• 3×32-bit floating point number or one 32-bit grayscale
1/10/2010
number
• Covers visible gamut
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Without compresion(compression would have bad results)
• Noise (invisible)
• Comments starts by # and ends by EOL
• After magic, or after data section
• Used by HDRShop
17
PFM - header
• 4 sequences of ASCII text each ends by white char
• magic „PF“ (color) or „Pf“ (grayscale)
1/10/2010
• Weight
• Height
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Byte order
• Endian (sign)
• Scale (value)
18
OpenEXR (.exr)
• Industrial light&magic (1999,2003 as open src.)
• First used in films like Men in black II or Harry Potter and Sorcerer‘s
stone
1/10/2010
• Data formats 16, 32 floating point or 32 integer
• Negative primaries
• variable image channels
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Scan-line or tiled (lines of data or random accces to subsquare)
• „Wrapper“
• Aditional information
• Nvidia & ATI integration of 16-bit fp variant
• Lossless or lossy compresion
• Used by : OpenEXR software C/C++ library
• Multi Thread support
• Covers visible gamut
• 10,7 order of magnitude 0,1% of relative precission 19
OpenEXR - data
• Channels
• Predefined (R,G,B,A)
1/10/2010
• Data format
• 16 bit Float
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• 32 bit Float
• 32 UINT
• Sampling
• Subsampling
• Tiles vs. Scaned lines
20
OpenEXR – data –tiled files
• Tiles
• Faster zooming
1/10/2010
• Random acces
• Multiple levels
• resolutions
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Types
• ONE_LEVEL
• MIPMAP_LEVELS
• RIPMAP_LEVELS
• Scan lines
• Easyier
• Fast sequencial read 21
• Possible random acces
OpenEXR – file structure
• Header
• Attributes
1/10/2010
• Basic
• Display/Data window
• Pixel Aspect Ratio
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Channels
• Compression
• LineOrder
• Screen Window Center/screen window resolution
• tileDescription
• pixels
22
OpenEXR - compression
• Lossless
• PIZ
• Wavelet transform, Huffman
1/10/2010
• The best (35-55%)
• ZIP
• RLE
• Lossy
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• PXR24
• For FLOAT type
• Reducets 32 to 24 bit
• Remove noise
• B44
• Only for HALF type
• Block of 32bytes compressed to 14 (44%)
• 22%
• B44A
• +4 Block of 16 bytes uniform compressed to 3 bytes (44%)
• Large unifrom areas 23
LogLuv 24/32
• Gregory Ward (1998)
• Logarithmic
1/10/2010
• uv representation (similar to YCC)
• 24 or 32 bits/pixel (10(16) log Luminiscence,7(8) u‘,7(8) v‘)
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• Sam Leffler‘s TIFF library
• Covers visible gamut
• 38 order of magnitude 0,3% of relative accuracy for 32
• 4.8 order of magnitude 1,1% of relative accuracy for 24
24
scRGB
• Microsoft & HP
• Linear representation
1/10/2010
• Extension of sRGB space
• Either 16-bits per primary
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• 48-bits/pixel using Linear encoding scRGB
• Or 12-bits per primary using Gamma encoding
• 36-bits/pixel RGB using Gamma encoding scRGB-nl
• 36 bits/pixel YCC using Gamma encoding scYCC-nl
• Covers visible gamut
• Try to be a standard
25
Pixar‘s log TIFF
• One of the first HDR encoding (80‘s)
• Logarithmic
1/10/2010
• Part of Sam Leffler‘s TIFF library
• 3.5 order of magnitude 0,4% of relative accuracy, but don‘t
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
cover visible gamut
• 33 bits per pixel (11R, 11G, 11B)
• Used by pixar in film recording
• ZIP lossless compresion
26
• JPEG-HDR
Others
• 3D rendering
• XSI (.map) by Softimage
By Tomáš Masařík for
1/10/2010
27
Počítačová Grafika I. at MFF UK
Sources
• Overal
• http://www.anyhere.com/gward/hdrenc/hdr_encodings.html
1/10/2010
• http://www.doschdesign.com/e_infobase/HDRI.pdf
• http://www.debevec.org/
By Tomáš Masařík for
Počítačová Grafika I. at MFF UK
• http://www.fxguide.com/article268.html
• http://luxal.dachary.org/webhdr/formats.shtml
• http://www.wikipedia.org/
• Format
• http://www.openexr.com/
• http://radsite.lbl.gov/radiance/
• http://gl.ict.usc.edu/HDRShop/PFM/PFM_Image_File_Format.ht
ml 28