get_pixel function