RAW, PPM and JPEG decoding