0

I'm looking for the simplest way to extract the embedded jpg preview from a Nikon raw file (.nef) in Python 2.7. How should I do this?

Chris
  • 35
  • 1
  • 5
  • Possible duplicate of [RAW Image processing in Python](https://stackoverflow.com/questions/2422050/raw-image-processing-in-python) – Farhan.K Feb 20 '18 at 11:45

1 Answers1

1

Although I have not been able to test it, it may work with rawpy to read the .nef file and imageio to save it as jpg:

import rawpy
import imageio

path = 'image.nef'
with rawpy.imread(path) as raw:
    rgb = raw.postprocess()
imageio.imsave('default.jpg', rgb)
otorrillas
  • 4,357
  • 1
  • 21
  • 34