python读取raw图片文件_Python中的RAW图像处理

博客介绍了如何利用Python库rawpy读取和处理RAW图像文件,如NEF格式。通过rawpy.imread()加载图像,然后使用raw.postprocess()进行后期处理,并用imageio保存为TIFF格式。rawpy库支持numpy数组操作和多种选项,包括直接访问未处理的Bayer数据。
摘要由CSDN通过智能技术生成

1586010002-jmsa.png

Are there any Pythonic solutions to reading and processing RAW images. Even if it's simply accessing a raw photo file (eg. cr2 or dng) and then outputting it as a jpeg.

Ideally a dcraw bindings for python, but anything else that can accomplish the came would be sufficient as well.

解决方案

A while ago I wrote a libraw/dcraw wrapper called rawpy. It is quite easy to use:

import rawpy

import imageio

raw = rawpy.imread('image.nef')

rgb = raw.postprocess()

imageio.imsave('default.tiff', rgb)

It works natively with numpy arrays and supports a lot of options, including direct access to the unprocessed Bayer data.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值