Add somewhat hacky CV version of conversion to gray p-image.