Pixel raw2 digi

Forward port of #1995.