DeltaE CIE76 구현

DeltaE_CIE76 구현
CIE76에 따른 색상 차이 계산

1 소스 코드[ | ]

<?php
function xmp_print($arr) { echo '<xmp>'; print_r($arr); echo '</xmp>'; }
function deltaE_CIE76($Lab1, $Lab2) {
	list($L1, $a1, $b1) = $Lab1;
	list($L2, $a2, $b2) = $Lab2;
	return sqrt( pow($L2-$L1, 2) + pow($a2-$a1, 2) + pow($b2-$b1, 2) );
}

$white = array(100.000, 0.005, -0.010);
$yellow = array(97.138, -21.556, 94.482);
$red = array(53.233, 80.109, 67.220);
$black = array(0, 0, 0);

$white_yellow = deltaE_CIE76($white, $yellow);
$yellow_red = deltaE_CIE76($yellow, $red);
$red_black = deltaE_CIE76($red, $black);

xmp_print("white_yellow = [$white_yellow]");
xmp_print("yellow_red = [$yellow_red]");
xmp_print("red_black = [$red_black]");

2 실행 결과[ | ]

white_yellow = [96.962909553086]
yellow_red = [114.04664788585]
red_black = [117.34450379119]

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}