Sponsor

The Apps


Noir. Cinematic black-and-white and lighting control for your iPhone and iPad.

Plastic Bullet. An infinite variety of vintage camera looks. Now available for Mac.

 

 

 

Cinematic looks for your iPhone and iPad movies.

Needables
  • Canon EOS 5D Mark III 22.3 MP Full Frame CMOS Digital SLR Camera (Body)
    Canon EOS 5D Mark III 22.3 MP Full Frame CMOS Digital SLR Camera (Body)
    Canon
  • 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
  • Canon EOS Rebel T3i 18 MP CMOS Digital SLR Camera and DIGIC 4 Imaging (Body Only)
    Canon EOS Rebel T3i 18 MP CMOS Digital SLR Camera and DIGIC 4 Imaging (Body Only)
    Canon
  • Zoom H4n Handy Portable Digital Recorder
    Zoom H4n Handy Portable Digital Recorder
    Zoom
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
Member Account Required
You must have a free and harmless member account in order to post comments. Log in to your account to enable posting. I don't use your information for anything, I just want you to be who you are.
« from nerd to bard | Main | terminology »