繁体   English   中英

如何在 Mac 上用 Python 将 NEF(原始图像文件类型)转换为 JPG?

[英]How to convert a NEF (raw image file type) to JPG in Python on Mac?

我正在尝试将 NEF RAW 图像转换为 JPG,但我发现并没有给出确切的肋骨值。 我使用的代码来自此链接: Using rawpy to convert multiple raw.NEF Images to TIFF

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

从这段代码来看,我似乎缺少蓝色值(是的,我已经更改了路径以使其与 Mac 兼容)。

谢谢

for i in path:
   with rawpy.imread(path) as raw:
      rgb = raw.postprocess()
      print(rgb)
      imagename = str(path)+str(i)+".jpg"
      imageio.imsave(imagename, rgb)

你能试试这个吗?

在我使用以下内容之前,我遇到了同样的问题:

rgb = raw.postprocess(rawpy.Params(use_camera_wb=True))
imshow(rgb)
plt.show()

左边显示之前和之后,只有 raw.postprocess() 在此处输入图像描述

import glob
# All files and directories ending with .txt and that don't begin with a dot:
a=(glob.glob("D:\\ND750-1\\*.NEF")) 
import rawpy
import imageio
from tqdm.notebook import tqdm


for i in tqdm(a):
    with rawpy.imread(i) as raw:
        rgb = raw.postprocess()
    imageio.imsave(i.replace('NEF','jpg'), rgb)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM