add function to do pixel rotation