Enable TIFF write of 'half' pixels, if "tiff:half" attribute is nonzero.#1283
Merged
lgritz merged 2 commits intoAcademySoftwareFoundation:masterfrom Dec 8, 2015
Merged
Enable TIFF write of 'half' pixels, if "tiff:half" attribute is nonzero.#1283lgritz merged 2 commits intoAcademySoftwareFoundation:masterfrom
lgritz merged 2 commits intoAcademySoftwareFoundation:masterfrom
Conversation
to make it match the way we allow those simple cases for ImageSpec and other places where we get/set attributes.
Set up a global OIIO attribute "tiff:half" that sets the default globally, and also have the ImageOutput for TIFF recognize a per-file "tiff:half" override. The default in both cases is 0, meaning that requests for half pixel float files in the absence this attribute nonzero will be automatically be upgraded to float, which is more widely read. The reason for this is that nearly every non-OIIO-based reader fails to correctly recognize half-valued pixels in TIFF files, including PhotoShop and Nuke 9. So you are urged not to write half tiff, unless you are sure that the only consumer of those files uses OIIO (which can read them properly), or have verified that other consumers in your pipeline get it right. Here is the Adobe tech report describing this TIFF extension: http://chriscox.org/TIFFTN3d1.pdf A typical OIIO use of this would be to create a half TIFF texture file: maketx in.tif -attrib tiff:half 1 -d half -o half.tx Why would you do this? Because in my benchmarks, texture access of a half TIFF texture file is nearly twice the raw read performance of the equivalent OpenEXR half texture.
Contributor
|
LGTM |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable TIFF write of 'half' pixels, if "tiff:half" attribute is nonzero.
Set up a global OIIO attribute "tiff:half" that sets the default globally, and also have the ImageOutput for TIFF recognize a per-file "tiff:half" override. The default in both cases is 0, meaning that requests for half pixel float files in the absence this attribute nonzero will be automatically be upgraded to float, which is more widely read.
The reason for this is that nearly every non-OIIO-based reader fails to correctly recognize half-valued pixels in TIFF files, including PhotoShop and Nuke 9. So you are urged not to write half tiff, unless you are sure that the only consumer of those files uses OIIO (which can read them properly), or have verified that other consumers in your pipeline get it right.
Here is the Adobe tech report describing this TIFF extension: http://chriscox.org/TIFFTN3d1.pdf
A typical OIIO use of this would be to create a half TIFF texture file:
Why would you do this? Because in my benchmarks, texture access of a half TIFF texture file is nearly twice the raw read performance of the equivalent OpenEXR half texture.
Along the way, I added the missing get_int_attribute, get_float_attribute, and get_string_attribute equivalents to the global OIIO::getattribute, to match how we have done it for the versions that are methods of ImageSpec, TextureSystem, and a number of other classes.