-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(oiiotool): oiiotool --layersplit, new command to split layers (#…
…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 <mugulmotion@gmail.com>
- Loading branch information
Showing
7 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Comparing "parts.exr" and "ref/parts.exr" | ||
PASS |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
|
||
|
||
# Test for oiiotool channel-name-based layer splitting | ||
# | ||
|
||
|
||
# test --layersplit | ||
command += oiiotool ("src/layers.exr --layersplit --siappendall -o parts.exr") | ||
|
||
# Outputs to check against references | ||
outputs = [ "parts.exr", "out.txt" ] | ||
|
Binary file not shown.