A new method for RGB to XYZ transformation based on pattern search optimization