A method for performing a three dimensional, hue-plane preserving and differentiable quasi-linear transformation on a given color with first color space R,G,B color channel values by using N 3 by 3 training color matrices defined by a set of N different chromatic training colors and a neutral white color; said method comprising the steps of i) providing first color space R,G,B color channel values for said given color; ii) calculating a first color space hue-angle for said first color space R,G,B color channel values for said given color provided in step i), iii) generating a first color space hue-angle specific 3 by 3 matrix capable of transforming said first color space R,G,B color channel values for said given color to second color space estimated X,Y,Z color channel values for said given color; and iv) transforming said first color space R,G,B color channel values for said given color to second color space estimated X,Y,Z color channel values for said given color by multiplying the first color space hue-angle specific 3 by 3 matrix for said given color with said first color space R,G,B color channel values for said given color; wherein said first color space hue-angle specific 3 by 3 matrix is a weighted, first color space hue-angle specific sum of the N training color matrices; wherein said first color space hue-angle specific 3 by 3 matrix is specific for the hue angle of said first color space R,G,B color channel values for said given color provided in step i); v) calculating, for each training color, the weight on each of said N training color matrices, as a parameter set dependent differentiable function of the minimum hue-angle difference between the first color space hue-angle of said given color and the first color space hue-angle of a training color for which the training color matrix is specific; vi) obtaining a weighted, first color space hue-angle specific sum by dividing the weight of individual training color matrices with the sum of the weights of all training color matrices; and vii) optimizing the set of parameters of the said parameter dependent differentiable function for global accuracy of the transformation of first color space R,G,B color channel values to estimated second color space X,Y,Z color channel values by minimizing a sum of distances between estimated and known second color space X,Y,Z color channel values from a predetermined training set of known training color channel values, wherein first color channel values are white balanced to unit values in the white color for each color channel by dividing all color channel values with the color value of the white of the first color space, and wherein said parameter set dependent differentiable function is selected from the group consisting of a power function of power p; a polynomial of order n with n+1 coefficients; a trigonometric function and an exponential function. i) providing first color space R,G,B color channel values for said given color; ii) calculating a first color space hue-angle for said first color space R,G,B color channel values for said given color provided in step i), iii) generating a first color space hue-angle specific 3 by 3 matrix capable of transforming said first color space R,G,B color channel values for said given color to second color space estimated X,Y,Z color channel values for said given color; and iv) transforming said first color space R,G,B color channel values for said given color to second color space estimated X,Y,Z color channel values for said given color by multiplying the first color space hue-angle specific 3 by 3 matrix for said given color with said first color space R,G,B color channel values for said given color; wherein said first color space hue-angle specific 3 by 3 matrix is a weighted, first color space hue-angle specific sum of the N training color matrices; wherein said first color space hue-angle specific 3 by 3 matrix is specific for the hue angle of said first color space R,G,B color channel values for said given color provided in step i); v) calculating, for each training color, the weight on each of said N training color matrices, as a parameter set dependent differentiable function of the minimum hue-angle difference between the first color space hue-angle of said given color and the first color space hue-angle of a training color for which the training color matrix is specific; vi) obtaining a weighted, first color space hue-angle specific sum by dividing the weight of individual training color matrices with the sum of the weights of all training color matrices; and vii) optimizing the set of parameters of the said parameter dependent differentiable function for global accuracy of the transformation of first color space R,G,B color channel values to estimated second color space X,Y,Z color channel values by minimizing a sum of distances between estimated and known second color space X,Y,Z color channel values from a predetermined training set of known training color channel values,