Pixel cleanup

Clean up pixel format related functions