-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
HasAlpha property set incorrectly on TIFF sRGB file #1429
Comments
ColorType is detected as TrueColor on 13.1.2 and as TrueColorAlpha on 12.3.0 |
The recent version of ImageMagick has made some improvements to read additional channels. The tiff library that is being used reports the following warning:
In earlier versions of ImageMagick we would not check this and assume the image has an alpha channel. But looking at the output image we probably fixed reading it? It now shows a colored image and it looks like the extra sample/channel contains a mask for certain areas of the image? |
how should i access the extra samples channel in the new version? i was doing |
There is no proper api to do that at this time. I will be going to add this but that will be going to take me a while because I am working on some big internal changes related to those flags. For now you can probably do this: |
i think it's better in my use case to revert to 12.3.0 for the moment. is there an issue i can subscribe to so i know when you're done with the changes? |
@dlemstra hi! i've looked into version 13.5.0 and channels.count and channelscount now match (4 for both), but hasalpha is still false on 13.5. i'd like to update as 12.3 is marked as vulnerable. is there any way to detect the channel as an alpha channel? new updated test code:
Output with 12.3:
Output with 13.5:
|
There is no option yet to directly assume that the 4th channel is an alpha channel so you will need to do this really expensive "trick": using (var lIM = new MagickImage(testFile))
{
using (var images = new MagickImageCollection(lIM.Separate()))
{
using (var image = images.Combine())
{
}
}
} I haven't made time yet to figure out how I can add an option for this. |
Magick.NET version
Magick.NET-Q8-x64 13.1.2
Environment (Operating system, version and so on)
Windows 10 22H2 Build 19045.3324
Description
TIFF file with sRGB colorspace fails to detect the alpha channel. It was correctly detected on version 12.3.0
Also, MagickImage.ChannelCount and MagickImage.Channels.Count are not equal for this sample
The file: 2001022-fullcolor.zip
Steps to Reproduce
The text was updated successfully, but these errors were encountered: