Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import rawpy
  2. import imageio
  3. import glob
  4. import os
  5. raw_file_type='cr2'
  6. file_location='D:\input'+'/'
  7. raw_images = glob.glob(file_location + '*' + raw_file_type)
  8. for raw_image in raw_images:
  9. file_name = os.path.basename(raw_image)[:-(len(raw_file_type)+1)]
  10.  
  11. with rawpy.imread(raw_image) as raw:
  12. rgb = raw.postprocess()
  13. imageio.imsave('D:\output'+'/'+file_name+'.png', rgb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement