Tools

Slugline. Simple, elegant screenwriting.

Red Giant Color Suite, with Magic Bullet Looks 2.5 and Colorista II

Needables
  • Sony Alpha a7S Compact Interchangeable Lens Digital Camera
    Sony Alpha a7S Compact Interchangeable Lens Digital Camera
    Sony
  • Panasonic LUMIX DMC-GH4KBODY 16.05MP Digital Single Lens Mirrorless Camera with 4K Cinematic Video (Body Only)
    Panasonic LUMIX DMC-GH4KBODY 16.05MP Digital Single Lens Mirrorless Camera with 4K Cinematic Video (Body Only)
    Panasonic
  • TASCAM DR-100mkII 2-Channel Portable Digital Recorder
    TASCAM DR-100mkII 2-Channel Portable Digital Recorder
    TASCAM
  • The DV Rebel's Guide: An All-Digital Approach to Making Killer Action Movies on the Cheap (Peachpit)
    The DV Rebel's Guide: An All-Digital Approach to Making Killer Action Movies on the Cheap (Peachpit)
    by Stu Maschwitz
Wednesday
Nov162005

sRGB

The sRGB luminance curve is designed to be an approximation of a gamma 2.2 curve, but with a straightline portion near zero to avoid rounding errors in conversions.

Duh.

It's hard to find good online resources with the to- and from-sRGB conversions expressed in language compatible with nerdy compositing applications, so I thought I’d consolidate some findings here.

Spitzak has the sRGB to linear conversion right:

x < .04045 ? x/12.92 : pow((x+.055)/1.055, 2.4)

And here’s its inverse:

x < .0031308 ? x*12.92 : (1.055*pow(x,1/2.4)) -0.055

The question mark is an if/then. If the conditional before it is true, do what’s before the colon. If false, do what’s after.

Boom.

Reader Comments (3)

Thank you very much for this info, very helpful for what I need right now!

Thanks again, cheers,

- loocas

March 21, 2009 | Unregistered Commenterloocas

how can you include softclipping in this formula?
vfx-pedia posted a way of soft cliping values above 1 in a floating point image.
http://vfxpedia.com/index.php?title=SoftClip_Description

March 23, 2009 | Unregistered CommenterAurora

That's a perfectly good softclipping formula, and you could experiment with including it either before or after the linear-to-sRGB conversion. There's no reason to merge the two into one formula if you're working in float.

March 23, 2009 | Registered CommenterStu
Comments Disabled
Sorry, comments are disabled temporarily while I tweak some stuff.
« from nerd to bard | Main | terminology »