//bad, when from file. Lost a lot from converting and round public static List <ArraysListInt> Lab2RGB(Bitmap img) { var labxyz = XYZandLab.Lab2XYZ(img); var xyzrgb = RGBandXYZ.XYZ2RGB(labxyz); return(xyzrgb); }
//L a b in double values (as after convert XYZ2lab; not in range [0 1]) //L a b arrays in In the following order L-a-b public static List <ArraysListInt> Lab2RGB(double[,] l, double[,] a, double[,] b) { List <ArraysListInt> rgbResult = new List <ArraysListInt>(); if (l.Length != a.Length || l.Length != b.Length) { Console.WriteLine("L a b arrays size dismatch in lab2rgb operation -> lab2rgb(double[,] L, double[,] a, double[,] b) <-"); } else { List <ArraysListDouble> labxyz = XYZandLab.Lab2XYZ(l, a, b); List <ArraysListInt> xyzrgb = RGBandXYZ.XYZ2RGB(labxyz); rgbResult = xyzrgb; } return(rgbResult); }
//L a b in double values (as after convert XYZ2lab; not in range [0 1]) //list L a b arrays in In the following order L-a-b public static List <ArraysListInt> Lab2RGB(List <ArraysListDouble> labList) { List <ArraysListInt> rgbResult = new List <ArraysListInt>(); if (labList[0].Color.Length != labList[1].Color.Length || labList[0].Color.Length != labList[2].Color.Length) { Console.WriteLine("L a b arrays size dismatch in lab2rgb operation -> lab2rgb(List<arraysListDouble> labList) <-"); } else { List <ArraysListDouble> labxyz = XYZandLab.Lab2XYZ(labList); List <ArraysListInt> xyzrgb = RGBandXYZ.XYZ2RGB(labxyz); rgbResult = xyzrgb; } return(rgbResult); }