-
Notifications
You must be signed in to change notification settings - Fork 608
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
[FEATURE REQUEST] oiiotool command to split "layers" into subimages or separate images #4546
Comments
Hey @lgritz, I can take a look at that ! |
I don't, but it should be easy to construct one with oiiotool -- it's really just a matter of making a low-res image with a bunch of channels that have the right names to group them into "layers."
Then what we want is a new command like
And then You can rely on the fact than when reading in the original multi-layer file, our exr reader will automatically reorder the channels (for apps using the OIIO API, not in the disk file itself) to group them by layer name. So you just need to walk the channel list and know that a new part starts any time the "pre-dot" part of the channel name changes, if you know what I mean. |
Perfect, thanks for all the info 😄 |
…4591) Implement FR from #4546 Add a new `--layersplit` command to `oiiotool` to split an image into its channel-name-based layers onto the stack. The extracted layer names are then stored in the `oiio:subimagename` metadata (in case it is needed for later use, e.g merging these "layers" as sub-images), and the extracted channel names replace the old channel names in the new images. Example: an image with channels `R, G, B, A, diffuse.R, diffuse.G, diffuse.B` will be split into two images, the first one with channels `R, G, B, A` and the second one named `diffuse` with channels `R, G, B`. > Note: we did not implement the `--layertosi` command suggested in the FR as it can already be done with a combination of `--layersplit` and `--siappendall` We add a test in the test suite that takes a "multi-layer" image, splits the layers and merges them as sub-images. The final image should have 3 sub-images. --------- Signed-off-by: Loïc Vital <[email protected]>
…cademySoftwareFoundation#4591) Implement FR from AcademySoftwareFoundation#4546 Add a new `--layersplit` command to `oiiotool` to split an image into its channel-name-based layers onto the stack. The extracted layer names are then stored in the `oiio:subimagename` metadata (in case it is needed for later use, e.g merging these "layers" as sub-images), and the extracted channel names replace the old channel names in the new images. Example: an image with channels `R, G, B, A, diffuse.R, diffuse.G, diffuse.B` will be split into two images, the first one with channels `R, G, B, A` and the second one named `diffuse` with channels `R, G, B`. > Note: we did not implement the `--layertosi` command suggested in the FR as it can already be done with a combination of `--layersplit` and `--siappendall` We add a test in the test suite that takes a "multi-layer" image, splits the layers and merges them as sub-images. The final image should have 3 sub-images. --------- Signed-off-by: Loïc Vital <[email protected]>
Just like we have oiiotool command
--sisplit
which splits an image's subimages (what exr calls "parts") into separate images on the oiiotool stack, it might be handy to have--layersplit
(split channel-name-based layers into separate images on the stack) and/or--layertosi
(split the layers in an image into an image organized by subimages/parts). In both cases, the layers would need to be deduced by looking at and grouping the channel names.Background:
Modern (>= 2.0) OpenEXR has "multi-part" files that can contain a different raster image in each part (for example, a beauty pass, reflections, isolated lights, mattes, etc). The parts are read separately, efficiently. When dinosaurs were alive and used OpenEXR 1.x, the lack of multi-part led to a convention called "multi-layer" exr, in which a ton of channels were jammed into a (single part of a) single image, and channels were grouped simply according to a naming convention, for example "LAYERNAME.channelname", and all the channels with the same LAYERNAME were considered a "layer" or group that conceptually goes together.
Ideally, nobody would know or care about this for the last several years, because they'd be using parts instead. But there is some software out there still making "multi-layer exr files" where dozens of channels are jammed into a single part. So maybe we need the equivalent of --sisplit for layers? (Note: we can already group separate images into a single image with multiple "layers" by using the existing --chappend plus ensuring that the channels are named according to the layer naming conventions, so we don't need a new command for going in that direction.)
The text was updated successfully, but these errors were encountered: