function z = rgb2yiq(x) % N T S C - > yiq % National Television System Committee % % P A L % Phase Alternating Line % % SECAM % Sequential Couleur Avec Memoire % or Sequential Color with Memory x = double(x); r = x(:,:,1); g = x(:,:,2); b = x(:,:,3); y = 0.2989*r + 0.5870*g + 0.1141*b; i = 0.5961*r - 0.2743*g - 0.3218*b; q = 0.2114*r - 0.5230*g + 0.3116*b; z(:,:,1) = y; z(:,:,2) = i; z(:,:,3) = q; z = round(100*z)/100;