Transform a key into a colour-coded image, then back into a key