0

I'm looking to be able to read in pixel values as captured in a raw NEF image, process the data for noise removal, and then save the new values back into the raw image format maintaining all the metadata for later use. I've seen dcraw can read in raw format and output the Bayer pattern data as a tiff or other image but I can't save it back to my NEF. I've also been attempting to read in and save the image with simple python file open or numpy memmap but have no clue how to handle the binary data. Any help would be appreciated. Thanks!

Richard
  • 43
  • 3
  • Converting back to raw would be a lossy step, you probably should keep it as a TIFF instead. I believe NEF is based on TIFF so the metadata should be compatible. – Mark Ransom Oct 05 '16 at 21:47
  • I was hoping to avoid TIFF altogether if I could. I'd like to handle all demosaicing and color adjustment in a program like Photoshop but I need to deal with identifying noise at individual pixels before demosaicing. So just access the raw data and removing the noise there shouldn't be lossy, I think? – Richard Oct 05 '16 at 22:10
  • Maybe I misunderstood. When you say you've used `dcraw` to read the file, do you mean reading it *without* demosaicing? Anyway, I believe the raw data is compressed so you won't be able to write it back in place, you'll need to create a whole new file. – Mark Ransom Oct 05 '16 at 22:18
  • Yep, I've been working with dcraw options to output the unaltered pixel values without demosaicing, white balancing, gamma correction etc. I would be fine with creating a new file, but I would need to transfer all the metadata and maintain a raw format to handle all those steps above in Photoshop – Richard Oct 05 '16 at 22:25

0 Answers0