Optimize pixel conversion functions

I've also removed the two helper functions *contextToRgbData* and *rgbDataToContext*, because it makes the code easier to read for me.
Nice; this looks a lot cleaner and is easier to understand