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

ImageWriter: Expose oiiomaketx flags #5959

Open
pier-robot opened this issue Jul 12, 2024 · 3 comments
Open

ImageWriter: Expose oiiomaketx flags #5959

pier-robot opened this issue Jul 12, 2024 · 3 comments

Comments

@pier-robot
Copy link

Summary

Add options to the ImageWriter node for use when writing tx files.

User story

Recently at IE we've run into a couple of cases where we've wanted to write tx files but the default behaviour of the Image Writer doesn't produce what we want, so we subprocess a call to oiiomaketx ourselves. It would be useful to have some flags exposed on the ImageWriter in the same way that options appear when writing exrs.

What

The flags we tend to use are:

--format FILEFORMAT Specify output file format (default: guess from extension)

-u                       Update mode
--nchannels N            Specify the number of output image channels.
-d TYPE                  Set the output data format to one of: uint8, sint8, uint16, sint16, half, float
--wrap WRAP              Specify wrap mode (black, clamp, periodic, mirror)
--colorconvert IN OUT    Apply a color space conversion to the image.
--resize                 Resize textures to power of 2 (default: no)
--fixnan STRATEGY        Attempt to fix NaN/Inf values in the image (options: none, black, box3)
--constant-color-detect  Create 1-tile textures from constant color inputs
--monochrome-detect      Create 1-channel textures from monochrome inputs
--opaque-detect          Drop alpha channel that is always 1.0

--oiio                   Use OIIO-optimized settings for tile size, planarconfig, metadata.

with format being the most important.

Why

We want to be able to specify the format of the tx file in specific situations.

@johnhaddon
Copy link
Member

I think there is a big enough difference in internal implementation that this might be better implemented as a separate TextureWriter node than as additional complexity in the ImageWriter node. If it were presented that way, would that cause any problems for your intended usage?

I suspect the most expedient implementation might also be to use an internal network with an ImageWriter/SystemCommand/LocalDispatcher combo rather than write more C++. So not all that far from what you're currently doing - just wrapped up nicely with a UI.

@johnhaddon
Copy link
Member

The other thing that occurs to me is that it might also be nice to provide a node which can create textures for files which already exist on disk - then you could use Gaffer to do batch texture conversion with any supported Dispatcher. If we had that, then the TextureWriter could use that internally.

@pier-robot
Copy link
Author

A TextureWriter node would certainly do the trick, there's no specific need for it to be an ImageWriter update. Thanks for the info! We can add this in IEGafferExtensions, as I imagine it's not the highest priority for you all.

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

No branches or pull requests

2 participants