HDR formats Imaging & Randering HDR vs. LDR

• HDR • Scene referred standard • Tone mapping

• Usefull for: 1/10/2010 • Many different output devices • Postprocessing • LDR •

Output referred standard Masařík for Tomáš By • sRGB

• 1,6 ordes of magnitude UK MFF at I. Grafika Počítačová • Don‘t cover visible gamut

2 History

• 1850 Gustav Le Gray combined negatives • 1940‘s Charles Wyckoff Picture of nuclear explosion • 1980‘s Film industry proprietary use • 1985 First HDR format by Gregory Ward Radiance 1/10/2010 • 1997 Paul Devebec recovering HDR from photograps • 1997 The Campanile movie

• First image editing program: HDRShop lead by Paul Devebec By Tomáš Masařík for Masařík for Tomáš By

• 2004 Valve Software used HDR rendering in Half life 2 Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

3 Uncompressed vs Lossy & • Each format is Lossy • Thery is only precision or implementation errors • Uncompressed formats

• PFM 1/10/2010 • Lossless compression formats • OpenEXR • Radiance

• LogLuv Tiff Masařík for Tomáš By

• Lossy compresion formats Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová • OpenEXR (Pixar‘s compression) • Future interest 4 Logarithmic vs. Linear & Gamma encoding • Logarithmic... • Linear... • Logarithmic examples • LogLuv TIFF 1/10/2010 • Pixar‘s TIFF • Lograithmic exp. examlples • Radiance • PFM Masařík for Tomáš By

• Linear examples Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová • scRGB • 5 • sRGB Colorspaces

• XYZ • CIE standard • Unreal primaries • RGB

• Negative primaries 1/10/2010 • sRGB • Gamma correction • Luv • Luminiscence

• u‘,v‘ vectors Masařík for Tomáš By • Convertible to XYZ

• YCC UK MFF at I. Grafika Počítačová • 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 • Human eye can see about 4 orders of magnitude at one time

• Possible magnitude is about 62 orders of magnitude 1/10/2010 • 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 Masařík for Tomáš By

magnitude Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

7 Gamut

• Spectrum of colors • Visible gamut: Human visible spectrum of colors • Colorspace covers gamut

• XYZ 1/10/2010 • sRGB with sign • Colorospace don‘t cover gamut

• sRGB

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

8

Comparison – table

1/10/2010

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

9

Comparison – magnitudes/bits

1/10/2010

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

10 11 By Tomáš Masařík for 1/10/2010 Počítačová Grafika I. at MFF UK Tagged Image (.tif, .) • Aldus • Adobe Systems since 2009 • TIFF 6.0 • TIFF/EP, TIFF/IP, GeoTIFF 1/10/2010 • Part of Exchangeable image file format () • Tag file format container (wrapper)

• LibTIFF by Sam Lefflare By Tomáš Masařík for Masařík for Tomáš By

• Scanners, Printers, Fax Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

12 RAW

• Special unprocessed format of Digital camera • No common specification – based on chipset of a camera • About 4 orders of magnitude (depends on type of camera)

• Nonlineary image data! 1/10/2010

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

13 Radiance (.pic, .hdr)

• Gregory Ward (1985) • 4 byte per pixel (R_mantisa, G_mantisa, B_mantisa, shared_exponent)

• 76 orders of magnitude 1% of relative accuracy 1/10/2010 • 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 Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

14 Radiance - header

• Magic: „#?RADIANCE“ • Keywords ended by empty line • Format (RGBE vs. XYZE)

• Exposure 1/10/2010 • Color corection • Software version

• ...

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

15 Radiance - resolution string

• Inline string • 4 values • Resolution X & Y

• In integer (N) 1/10/2010 • Flipping & Rotation (sign) • Example

• -Y N +X N

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

16 Portable float map (.pfm)

• Paul Devebec • 3×32-bit floating point number or one 32-bit grayscale number

• Covers visible gamut 1/10/2010 • Without compresion(compression would have bad results) • Noise (invisible) • Comments starts by # and ends by EOL • After magic, or after data section Masařík for Tomáš By

• Used by HDRShop UK MFF at I. Grafika Počítačová

17 PFM - header

• 4 sequences of ASCII text each ends by white char • magic „PF“ (color) or „Pf“ (grayscale) • Weight

• Height 1/10/2010 • Byte order • Endian (sign)

• Scale (value)

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

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 • Data formats 16, 32 floating point or 32 integer

• Negative primaries 1/10/2010 • variable image channels • Scan-line or tiled (lines of data or random accces to subsquare) • „Wrapper“ • Aditional information

• Nvidia & ATI integration of 16-bit fp variant Masařík for Tomáš By • Lossless or lossy compresion

• Used by : OpenEXR software C/C++ library UK MFF at I. Grafika Počítačová • 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) • Data format

• 16 bit Float 1/10/2010 • 32 bit Float • 32 UINT • Sampling

• Subsampling Masařík for Tomáš By

• Tiles vs. Scaned lines Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

20 OpenEXR – data –tiled files

• Tiles • Faster zooming • Random acces

• Multiple levels 1/10/2010 • resolutions • Types • ONE_LEVEL

• MIPMAP_LEVELS By Tomáš Masařík for Masařík for Tomáš By • RIPMAP_LEVELS

• Scan lines UK MFF at I. Grafika Počítačová • Easyier • Fast sequencial read 21 • Possible random acces OpenEXR – file structure

• Header • Attributes • Basic

• Display/Data window 1/10/2010 • Pixel Aspect Ratio • Channels • Compression • LineOrder

• Screen Window Center/screen window resolution By Tomáš Masařík for Masařík for Tomáš By • tileDescription

• pixels UK MFF at I. Grafika Počítačová

22 OpenEXR - compression

• Lossless • PIZ • transform, Huffman • The best (35-55%) • ZIP • RLE 1/10/2010 • Lossy • PXR24 • For FLOAT type • Reducets 32 to 24 bit • Remove noise • B44 Masařík for Tomáš By • Only for HALF type

• Block of 32bytes compressed to 14 (44%) Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová • 22% • B44A • +4 Block of 16 bytes uniform compressed to 3 bytes (44%) • Large unifrom areas 23 LogLuv 24/32

• Gregory Ward (1998) • Logarithmic • uv representation (similar to YCC) • 24 or 32 bits/pixel (10(16) log Luminiscence,7(8) u‘,7(8) v‘) 1/10/2010 • Sam Leffler‘s TIFF library • Covers visible gamut

• 38 order of magnitude 0,3% of relative accuracy for 32 By Tomáš Masařík for Masařík for Tomáš By

• 4.8 order of magnitude 1,1% of relative accuracy for 24 Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

24 scRGB

• Microsoft & HP • Linear representation • Extension of sRGB space • Either 16-bits per primary 1/10/2010 • 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 Masařík for Tomáš By

• Covers visible gamut UK MFF at I. Grafika Počítačová • Try to be a standard

25 Pixar‘s log TIFF

• One of the first HDR encoding (80‘s) • Logarithmic • Part of Sam Leffler‘s TIFF library • 3.5 order of magnitude 0,4% of relative accuracy, but don‘t 1/10/2010 cover visible gamut • 33 bits per pixel (11R, 11G, 11B) • Used by pixar in film recording

• ZIP lossless compresion Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

26 Others

• JPEG-HDR • XSI (.map) by Softimage

• 3D rendering

1/10/2010

By Tomáš Masařík for Masařík for Tomáš By Počítačová Grafika I. at MFF UK MFF at I. Grafika Počítačová

27 Sources

• Overal • http://www.anyhere.com/gward/hdrenc/hdr_encodings.html • http://www.doschdesign.com/e_infobase/HDRI.pdf

• http://www.debevec.org/ 1/10/2010 • http://www.fxguide.com/article268.html • http://luxal.dachary.org/webhdr/formats.shtml • http://www.wikipedia.org/

• Format Masařík for Tomáš By • http://www.openexr.com/ • http://radsite.lbl.gov/radiance/ UK MFF at I. Grafika Počítačová • http://gl.ict.usc.edu/HDRShop/PFM/PFM_Image_File_Format.ht ml 28