-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
Add support for decoding Tiff images with associated alpha data #2062
Conversation
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/Rgba16161616TiffColor{TPixel}.cs
Show resolved
Hide resolved
@brianpopow Do you want this in 2.1? I can hold a release 'til we get it done. |
@brianpopow I updated your PR to use the built in operations. I had to tweak the tolerance slightly but the output is mostly the same (better alpha blending of edge pixels with I'm curious as to why there is such a significant difference from the reference as I cannot see an obvious issue. |
@brianpopow I might have found quite a serious issue with the Tiff decoder I hadn't spotted before. We use I'm going to update and fix in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I dont think this should block 2.1 for this and it can be added for future.
Good spot 👍
That was also my first thought, but I was getting different results then the reference decoder, so I was leaving it to the manual calculation.
Let me double check that, but last time I checked any difference to the reference decoder was always off by exact 1, which I blamed on floating point inaccuracies. |
The hardware accelerated code should be super accurate. (More so than software) and is well tested so I think the reference decoder might have an issue. That and the same method used for the other color type works just fine. (I wonder if we can compare also with System Drawing?) I’m happy for this to go in as-is unless you can find something significant. |
@brianpopow I just did a comparison using the System.Drawing reference decoder and the tests pass with the original comparison tolerance of .0.001F. This is definitely good to go. |
Prerequisites
Description
This PR adds support for decoding Tiff images with associated alpha data: The alpha data is pre-multiplied.