Learning the image processing pipeline