reworked rgb2yuv to fit in the framework