A crude Python adaptation of http://www.cs.huji.ac.il/~yweiss/Colorization/