added translation of Kim Asendorf's work on pixel sorting, in python