Skip to content

[css-color-4] Transfer function for ProPhoto RGB #5229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
svgeesus opened this issue Jun 17, 2020 · 4 comments
Closed

[css-color-4] Transfer function for ProPhoto RGB #5229

svgeesus opened this issue Jun 17, 2020 · 4 comments
Assignees
Labels
css-color-4 Current Work

Comments

@svgeesus
Copy link
Contributor

In the predefined colorspaces, the transfer function for prophoto-rgb is stated to be 1.8.

In Design and Optimization of the ProPhoto RGB Color Encodings, by the authors of ProPhoto RGB, the transfer function is described thus:

a nonlinear encoding (1/1.8 power with a linear toe segment) was added to create the ROMM (Reference Output Medium Metric) RGB color space, intended for display-referred data.

On the ICC website, an extract of ISO 22028-2:2013 (which defines ROMM, and thus ProPhoto RGB shows an equation

If Rr, Gr, or Br are less than 0.001953
R = Rr*16 
G = Gr*16 
B = Br*16 

If Rr, Gr, or Br are greater than or equal to 0.001953 
R = Rr^1/1.8
G = Gr^1/1.8
B = Br^1/1.8

The Wikipedia article appears to be accurate and describes a similar toe, with a breakpoint at Et

Et = 16 ** (1.8 /(1 - 1.8) = 2 ** -9 = 1/512 = 0.0019525

which is the same as the ISO standard but with an explanation of the magic number (and one more digit of precision).

I have heard that an ICC profile distributed by Adobe with Photoshop is described as ProPhoto but uses a simple 1.8 gamma with no toe. (I have also heard that they distribute a similar ICC profile described as sRGB with a simple 2.2 gamma). This may be the origin of the 1.8 gamma often described for ProPhoto RGB. Also, on an 8-bit (0 to 255) system, the breakpoint occurs midway between codes 0 and 1 so has no effect. However, due to the very wide gamut, at least 10 and more likely 12 bits of precision are needed to avoid banding, so the toes does affect the rendered result.

I intend therefore to change the transfer curve in the specification, and the sample code, setting the constant for the breakpoint as 1/512.

@svgeesus
Copy link
Contributor Author

I see Bruce Lindbloom also gives the gamma as a simple 1.8

@svgeesus
Copy link
Contributor Author

svgeesus commented Jun 17, 2020

The original Kodak specification for ProPhoto RGB is 404 and their current website has no search function. But Web Archive has it

@svgeesus
Copy link
Contributor Author

From the Kodak whitepaper:

One potential use of the ROMM RGB color space is as a working color space for Adobe Photoshop software. However, it should be noted that Adobe Photoshop software currently limits the nonlinearity that can be used to define a valid working space to be a simple gamma function. However, both the Adobe Photoshop software implementation,as well as the Kodak Color Matching Module (CMM) implementation automatically impose a “slope limit” of 16 at the dark end of the tone scale. Although a profile that explicitly incorporates the nonlinearity with the slope limit can not be used by Adobe Photoshop software, a profile using a simple gamma function nonlinearity produces the net effect of Eq. (2) when used by Adobe Photoshop software or the current version of the Kodak CMM. Therefore, to ensure Adobe Photoshop software compatibility, the ROMM RGB ICC profile created by Eastman Kodak Company uses a simple gamma function nonlinearity without the slope limit, rather than the form shown in Eq. (2). At some point in the future it may be possible to produce a new ICC profile that explicitly incorporates the slope limit if Adobe were to modify the Photoshop software software to remove this artificial restriction. Although this would not have any effect on the results obtained using Adobe Photoshop software or the Kodak CMM, it would increase the likelihood that equivalent results would be obtained using different CMMs that may or may not include the same slope limiting feature

@Myndex
Copy link
Member

Myndex commented Nov 25, 2020

Adobe ICC profiles for RGB spaces by and large use the simple exponent method and not the piecewise, and this includes their profiles for sRGB and Rec709 that ship with AfterEffects.

As a side note, ProPhoto is pretty useless for 8bit RGB, the ∆E errors are substantial. Even 10bit is not enough, though 15 or 16 is okay. The only "real" use case for it is being able to edit images destined for 4+ color printing while remaining in an RGB space. Hence the 1.8 gamma and the D50 wp.

When doing pre-press, editing images in CMYK is gruesome — ProPhoto alleviates much of that. But ProPhoto is a terrible colorspace for many common use cases such as images for display on RGB monitors or for cinema/video applications — ProPhoto is a really bad workflow choice for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-color-4 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants