tvogels / pyexr

One-line EXR IO-library

Home Page:https://github.com/tvogels/pyexr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Written files can't be opened by other programs

PaulStahr opened this issue · comments

I don't know if I'm doing something wrong. Opening files written by pyexr in other programs causes weird behaviour.

import numpy as np
import pyexr
import imageio

pyexr.write("test.exr", np.asarray([[0,1],[2,3]], dtype=np.float32))
print(pyexr.read("test.exr"))
print(imageio.imread("test.exr"))

The Output is:

[[[0.]
  [1.]]

 [[2.]
  [3.]]]
WARNING:root:imageio.freeimage warning: Warning: loading color model Z as Y color model
[[0. 0.]
 [0. 0.]]

https://github.com/tvogels/pyexr/files/5156542/test.zip

I also tried gimp, but it refuses completely to open the files, saying that the corresponding plugin crashed.

Edit: Using the 'Y'-channel for writing, reading the file back in works, but because of the different color-interpretation I won't consider this as a usable workaround. Maybe the problem has to be searched in the OpenEXR python-library.

Different programs/plugins make assumptions about channel names when loading EXR images. It's best to explicitly provide the channel names for the data you are writing.