-
-
Notifications
You must be signed in to change notification settings - Fork 887
Add support for decoding 24 and 32 bit tiff images #1724
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
Conversation
| public void TiffDecoder_CanDecode_96Bit<TPixel>(TestImageProvider<TPixel> provider) | ||
| where TPixel : unmanaged, IPixel<TPixel> | ||
| { | ||
| // Note: because the MagickReferenceDecoder fails to load the image, we only debug save them. |
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.
Magick.Net can actually decode the images, but in MagickReferenceDecoder I am not sure how to correctly transfer the pixel byte data from Magick.Net to our format.
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.
@dlemstra Would you be able to assist here?
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.
I will go ahead and merge this now. It would be still useful to know if we can use Magick.Net for images with color channel bit depth >= 24. We can add this in a future PR, if it is possible.
Codecov Report
@@ Coverage Diff @@
## master #1724 +/- ##
==========================================
+ Coverage 84.37% 84.40% +0.02%
==========================================
Files 822 830 +8
Lines 36033 36262 +229
Branches 4200 4238 +38
==========================================
+ Hits 30404 30607 +203
- Misses 4814 4839 +25
- Partials 815 816 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
| { | ||
| for (int x = 0; x < pixelRow.Length; x++) | ||
| { | ||
| data.Slice(offset, 3).CopyTo(buffer.AsSpan(bufferStartIdx)); |
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.
small improvement, you can save buffer.AsSpan(bufferStartIdx) to variable before loops
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.
I think that would be a more significant speed up than you think.
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.
changed with 4e5dec9
JimBobSquarePants
left a comment
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 Great work! 👍
| public void TiffDecoder_CanDecode_96Bit<TPixel>(TestImageProvider<TPixel> provider) | ||
| where TPixel : unmanaged, IPixel<TPixel> | ||
| { | ||
| // Note: because the MagickReferenceDecoder fails to load the image, we only debug save them. |
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.
@dlemstra Would you be able to assist here?
# Conflicts:
# src/ImageSharp/Formats/Tiff/PhotometricInterpretation/BlackIsZero16TiffColor{TPixel}.cs
# src/ImageSharp/Formats/Tiff/PhotometricInterpretation/Rgb161616TiffColor{TPixel}.cs
Prerequisites
Description
This PR adds support for the following tiff images: