Sorry....i dont understand, .red instead of .blue? I'm feeding pixel_color to the function, not pixel_color.red or pixel_color.blue. I use if(pixel_color.red) after calling pixel_to_vec() to determine if there is any red in the pixel that is read from the bitmap. The program is crashing when it calls pixel_to_vec(), not when it tries to evaluate if(pixel_color.red).