Connect to the BC6 decoding from Python#1
Closed
radarhere wants to merge 2 commits intoShadelessFox:mainfrom
Closed
Connect to the BC6 decoding from Python#1radarhere wants to merge 2 commits intoShadelessFox:mainfrom
radarhere wants to merge 2 commits intoShadelessFox:mainfrom
Conversation
Owner
ShadelessFox
left a comment
There was a problem hiding this comment.
Your image looks faded because of truncation to uint8. I don't think that's the result we want to achieve.
I believe the BC6 decoder should accept an additional parameter, gamma, just like the BC7_UNORM_SRGB variant.
Then, the result of bc6_finalize should be gamma-corrected, normalized to be in the range 0..255 (since it's an HDR container and its values may go beyond 0..1), and only then scaled down to 255.
Owner
|
Fixed in 5087356 |
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.
Helps python-pillow#6449
Two changes here.
After this PR, with your code as well,
gives
bc6_finalizefor unsigned data.As per the comment in the code, the
half_to_floatfunction is taken from https://gist.github.com/rygorous/2144712. It ishalf_to_float_fast5. Except, that code is for converting FP16 into FP32. FP16 has 1 sign bit, 5 exponent bits and then 10 bits for the fraction. Unsigned BC6H has 5 exponent bits and then 11 bits for the fraction. So instead of scaling it down from 65535 to 31743, I'm just scaling it down to 255.