Author Topic: typo in XISF doc  (Read 3097 times)

Offline dmcclain

  • PixInsight Addict
  • ***
  • Posts: 117
typo in XISF doc
« on: 2016 March 10 10:39:06 »
I was trying to grapple with color systems, understanding L*a*b* in relation to RGB. So I copied the equations from the XISF doc into Mathematica to experiment with the effects of chrominance stretching. Along the way, I found some typos in Equation [16] for conversion from L*a*b* to XYZ.

The ancillary function g
  • represents the inverse function of ancillary function f
  • in Equations [12],[13], and [15]. As such, Equation [16] should not include Y in the argument lists of g[] for conversion of a* and b* to X and Z. Rather, Y should be placed outside of the argument list of g[].


----
Sorry... that isn't correct either. Ancillary functions f[] and g[] are nonlinear functions and can't be so easily inverted.

The correct expression should have f[Y] in place of Y in equations for X and Z.
« Last Edit: 2016 March 10 10:45:47 by dmcclain »

Offline dmcclain

  • PixInsight Addict
  • ***
  • Posts: 117
Re: typo in XISF doc
« Reply #1 on: 2016 March 10 10:49:59 »
So with the correct equations in place, the system is invertible. But if I apply a chrominance stretch of 1.5 against RGB = {0.5,0,0} (mid-level red), I end up with an RGB result of {0.73, -0.23, 0}.

How does PI deal with negative RGB components?

[chrominance stretch just uniformly scales the a* and b* components, no?]

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: typo in XISF doc
« Reply #2 on: 2016 March 10 11:51:38 »
I'm 99% sure that out of range values are cropped. You may do some workarounds, expanding the range and rescaling, in the code, But I'm not sure that this would guarantee a good overall color rendition, or that the result is meaningfull.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: typo in XISF doc
« Reply #3 on: 2016 March 11 03:33:41 »
Hi David,

Yes, Equation 16 was wrong. This error is now fixed in the DRAFT 7.1 document I have just uploaded:

http://pixinsight.com/doc/docs/XISF-1.0-spec/XISF-1.0-spec.html

You may need to refresh your browser if the previous version is still cached. Here is a direct link to Section 8.5.4.5 CIE L*a*b* to CIE XYZ Conversion.

Thank you so much for detecting this error. I am working right now in the final XISF 1.0 specification document, so this correction has arrived just in time. I would have hated having to release an errata supplement just to fix this!

Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: typo in XISF doc
« Reply #4 on: 2016 March 11 04:07:20 »
Quote
How does PI deal with negative RGB components?

If you get pixel sample values outside [0,1] after a Lab->RGB conversion in PixInsight, then the resulting color is out of gamut, that is, outside the underlying RGB working space. In such case, out of range values are truncated to [0,1].
Juan Conejero
PixInsight Development Team
http://pixinsight.com/