set pixel type depending on input image