簡體   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