I have 22 colors which I want to use to draw any image with just these 22 colors.
Image image = GetImageFromURL(""); // returns an image object
Bitmap bitmap = new Bitmap(image);
String[] colors = {
"#FFFFFF", // white
"#C1C1C1", // light grey
"#EF130B", // red
"#FF7100", // orange
"#FFE400", // yellow
"#00CC00", // light green
"#00B2FF", // cyan
"#231FD3", // blue
"#A300BA", // purple
"#D37CAA", // pink
"#A0522D", // light brown
"#000000", // black
"#4C4C4C", // dark grey
"#740B07", // dark red
"#C23800", // dark orange
"#E8A200", // dark yellow
"#005510", // dark green
"#00569E", // dark cyan
"#0E0865", // dark blue
"#550069", // dark purple
"#A75574", // dark pink
"#63300D", // dark brown
};
How would I do this best? I currently have no idea how to translate billions of colors to just these 22 colors...
I would appreciate any help, thanks in advance.