The Colourful .net library does exactly that.
But the suggested single pixel image is a fast way and you can add a Parallel.For loop too. The color result can be obtained by reading the pixel or with img.Histogram().First().Key;

test this code with a known online converter, I may be wrong about magicknet way of doing it