Re: LCH values software? -- footnote
Re: LCH values software? -- footnote
- Subject: Re: LCH values software? -- footnote
- From: John Ward <email@hidden>
- Date: Mon, 20 Aug 2007 12:50:07 -0600
On June 11 and 12 (2007) there were a number of posts about calculating
LCH values from Lab values. For the special case of neutrals (a*=0 and
b*=0) this is an addendum to the correct Excel formula posted by Mauro
Boscarol.
Hue angle is undefined for the case of neutrals. So far as I know it can
be anything you like but my preference is for 0 (zero). Some
realizations (e.g., Mathcad 2000) of the ATAN2 formula appear to handle
neutrals in this way but Mauro's formula in Excel97 (WinXP) returns a
#DIV/0! error. This may be fine if one is just doing a calculation of a
table of LCH values but it may prove inconvenient if the result is used
as input to other formulas.
Also on 12 Jun 2007 Thomas Richard posted links to his Excel spreadsheet
which does the hue angle calculation and treats the neutrals as I
propose. However, his spreadsheet calculates hue angle on the range from
-180 deg to +180 deg instead of the conventional range from 0 to 360
deg.
To avoid the Excel error with neutrals, use the following Excel formula
(I am referring to the same C3 and D3 cells for a* and b* Mauro used in
his example):
=IF(AND(C3=0,D3=0),0,<Mauro's formula>)
For completeness, the whole long messy formula then becomes:
=IF(AND(C3=0,D3=0),0,IF(DEGREES(ATAN2(C3,D3))<0,DEGREES(ATAN2(C3,D3))+360,IF(DEGREES(ATAN2(C3,D3))>=360,DEGREES(ATAN2(C3,D3))-360,DEGREES(ATAN2(C3,D3)))))
I don't know if my way of writing this formula is any more transparent
but it is shorter:
=IF(AND(C3=0,D3=0),0,IF(D3>=0,(180/PI())*ATAN2(C3,D3),360+(180/PI())*ATAN2(C3,D3)))
For about a million randomly generated (a*, b*) these two formulas give
identical results but this doesn't make them mathematically identical.
If anyone finds a problem in my formula, please email me because I have
spreadsheets littered with it <g>.
Hope this is of interest to the Excel partisans.
John
============
A couple of applicable references to avoid going back through the
archives:
On 12 Jun 2007 09:22:53 Marco Ugolini wrote:
> Mauro Boscarol's message (posted yesterday) contains the exact
> formulas (tricky math included) to be placed in an Excel worksheet
> for the desired Lab-to-LCH(ab) conversion.
>
> I checked the results in Excel against both Bruce Lindbloom's CIE Color
> Calculator and Robin Myers' Color Converter utility, and they match.
On 12 Jun 2007 12:49:43 Derek Lambert wrote:
> I played also with Monaco/Xrite software and I actually found out
> that ColorPort (free) allows you to export LAB and LCH data as CSV or
> TAB delimited files. I opened them in Excel and used formulas Mauro
> gave me to confirm and the ColorPort numbers were matching.
> ColorThink is also great and the numbers match Excel formula.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Colorsync-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden