AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO

[FEATURE REQUEST] Optimize ImageInput::read_tiles for multi-part EXR

Open
#3,413 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.4k
Forks
698
Avg merge
3d 9h
Merged PRs (30d)
48

Description

In the case of EXR tiled multi-part files, ImageInput::read_tiles will almost never fall in the case
```
if (native_data && contiguous
&& (xend - xbegin) == nxtiles * spec.tile_width
&& (yend - ybegin) == nytiles * spec.tile_height
&& (zend - zbegin) == nztiles * spec.tile_depth)
```
because it only works if the image has size multiple of tile size.

Then the code goes into ImageInput::read_tile which forgets completly about the requested number of channels and ends up decoding all the channels, just to return at the end the channels that were requested.
For high resolution EXR files with a lot of channels, this makes openimageio compltely unviable when encoutering tiled EXRs.

Could this case be adapted to just decode the requested channels in the first place?

Contributor guide

Open the contributing guide

Research direction

Trace ImageInput::read_tiles and ImageInput::read_tile, focusing on the multi-part tiled EXR path and requested-channel handling. Compare the fast-path conditions with the fallback behavior; done means the fallback avoids decoding unrequested channels while preserving correct tile reads.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.