使用rawpy将多个原始.NEF图像转换为TIFF [英] Using rawpy to convert multiple raw .NEF Images to TIFF

查看:71
本文介绍了使用rawpy将多个原始.NEF图像转换为TIFF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在通过这个论坛进行搜索,但是找不到与我的问题有关的答案.我只找到了单个文件转换的解决方案.

I have been searching through this forum but cannot find a relevant answer to my problem. I have only found solutions for single file conversions.

我想将尼康RAW图像(.NEF)的 目录 转换为TIFF(.tiff).这显然可以通过 rawpy 插件来实现.我不太精通python,已尽力而为.您可能会发现我的脚本可笑:)

I want to convert a directory of Nikon RAW images (.NEF) into TIFF (.tiff). This can be achieved with the rawpy plugin apparently. I am not well versed in python and have done my best. You will probably find my script laughable :)

理想情况下,我希望能够将目录路径粘贴到命令行中,并将其转换为16位tiff.

I'd like to ideally be able to paste the directory path into the command line and have it convert everything for me, into 16-bit tiffs.

import rawpy
import imageio

paths = 'C:\Users\Jake\Desktop\Exposuretests\Darks'

for i in paths:
    with rawpy.imread(paths) as raw:
        rgb = raw.postprocess()
imageio.imsave(paths + '.tiff', rgb)

在此先感谢所有人的帮助.我相信这对于精通python的人来说非常简单!

Thanks all in advance for any help. I am sure this is quite simple for those versed in python!

推荐答案

如果使用大多数Linux发行版和适用于macOS和Windows.

You can do it very simply without having to write any Python or loops if you use ImageMagick which is installed on most Linux distros and is available for macOS and Windows.

在终端中,只需键入:

magick mogrify -format tif *NEF

这篇关于使用rawpy将多个原始.NEF图像转换为TIFF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆