pyxelate implementation