Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added EXR support #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Added EXR support #11

wants to merge 3 commits into from

Conversation

Jerry-Master
Copy link

The run.py now can read EXR files and write EXR files. It creates an extra folder for saving the EXR with float32 precision, which are ready to be used in current VFX pipelines. It also clamps the input to 0-1, a more interesting approach may be to use logarithmic color space but that is shot dependant so I did not include it.

Comment on lines +131 to +138
img = pyroexr.load(rgb_path)
exrnparray = np.dstack((img.channel('R'), img.channel('G'), img.channel('B')))
exrnparray = np.clip(exrnparray, 0, 1)
input_image = (exrnparray ** (1 / 2.2)).astype(np.float32)
input_size = (input_image.shape[1], input_image.shape[0])
else:
input_image = Image.open(rgb_path)
input_size = input_image.size
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use use OpenCV for reading EXRs?

For example:

img = cv2.imread(rgb_path, cv2.IMREAD_UNCHANGED)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants