letmaik / rawpy

📷 RAW image processing for Python, a wrapper for libraw
https://pypi.python.org/pypi/rawpy
MIT License
591 stars 67 forks source link

modify the raw_image attribute ? #93

Closed amonod closed 4 years ago

amonod commented 4 years ago

Hello,

From the rawpy documentation, we gather that the raw_image attribute of a RawPy object can only be accessed while the instance is open. From the _rawpy.pyx file, we can also read that

Modifying the returned array directly influences the result of calling :meth:~rawpy.RawPy.postprocess.

However, there is no way to modify that array, as there is no setter for that attribute, leading to AttributeError issues

'raw_image' of 'rawpy._rawpy.RawPy' objects is not writable

Would there be any chance of allowing modifications to raw_image within the RawPy instance in future versions ?

(P.S: I'm no python expert user so hopefully this is not me just being stupid and missing something.)

amonod-gpfw commented 4 years ago

I actually found from issue #54 that you can change the values of raw_image by writing raw.raw_image[:] = new_data[:]. Funny you can't directly assign a new array to raw_image though !