I'm trying to save images that were processed (started as Raw Image, want to save it back to Raw/dng/nef) This given ndarray is just -1,0,1 where certain pixels exceeded a threshold
I'm having trouble grasping what the issue is here :
imageio.imsave('images/imagesTest', image.Red.ZthreshMap)
Given this I get this error back :
File "C:\Users\E\--\PycharmProjects\lib\site-packages\imageio\core\functions.py", line 303, in imwrite
writer = get_writer(uri, format, "i", **kwargs)
File "C:\Users\E\--\PycharmProjects\lib\site-packages\imageio\core\functions.py", line 227, in get_writer
"Could not find a format to write the specified file in %s mode" % modename
ValueError: Could not find a format to write the specified file in single-image mode
I confirmed just in case that I'm supplying the function with the right data type:
<class 'numpy.ndarray'>
Is what the type is so that should work fine.
So I tried this where I specify the file type:
imageio.imsave('images/imagesTest.dng', image.Red.ZthreshMap, '.dng')
File "C:\Users\E\--\PycharmProjects\lib\site-packages\imageio\plugins\freeimage.py", line 127, in _append_data
self._bm.allocate(im)
File "C:\Users\E\--\PycharmProjects\lib\site-packages\imageio\plugins\_freeimage.py", line 825, in allocate
raise ValueError("Cannot write arrays of given type and shape.")
ValueError: Cannot write arrays of given type and shape.
Which is strange because I double checked the shape and:
print(image.Red.ZthreshMap.shape)
ends up resulting in (1434, 2160)
Any recommendations?