We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When a 32-bit ARGB BMP file is loaded using ITK, the colors are all mixed up.
BMP files with transparency are stored with ARGB channel order. It seems that ITK assumes RGBA order.
Load this image using ITK: https://1drv.ms/u/s!Arm_AFxB9yqHxcpbEw34sbS-h1pjkA?e=cf39o8
img = sitk.ReadImage('15-14-49.bmp') myshow(img) # incorrect
nda = sitk.GetArrayFromImage(img) img2=sitk.GetImageFromArray(nda[:,:,[1,2,3,0]]) myshow(img2) # correct
Colors should appear correctly in an application, regardless of what file format is loaded from (png, jpg, bmp, ...)
Colors are not correct if BMP format is used (if transparency is stored with the image).
100%
v5.2.0
all (Windows and Linux tested)
See original user report at https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095/3
The text was updated successfully, but these errors were encountered:
ENH: fix Windows Bitmap (BMP) channel order ABGR -> BGRA
9f50b1c
Closes InsightSoftwareConsortium#2596.
It turns out BMP files use BGR and BGRA order. ITK assumed ABGR instead. #2596 fixes that.
@leodemachado can you confirm? I guess this will need to be integrated into Slicer first 😄
Sorry, something went wrong.
dc6d200
Updated regression test baseline. Closes InsightSoftwareConsortium#2596.
41600c4
29e60cd
dzenanz
Successfully merging a pull request may close this issue.
When a 32-bit ARGB BMP file is loaded using ITK, the colors are all mixed up.
Description
BMP files with transparency are stored with ARGB channel order. It seems that ITK assumes RGBA order.
Steps to Reproduce
Load this image using ITK: https://1drv.ms/u/s!Arm_AFxB9yqHxcpbEw34sbS-h1pjkA?e=cf39o8
Expected behavior
Colors should appear correctly in an application, regardless of what file format is loaded from (png, jpg, bmp, ...)
Actual behavior
Colors are not correct if BMP format is used (if transparency is stored with the image).
Reproducibility
100%
Versions
v5.2.0
Environment
all (Windows and Linux tested)
Additional Information
See original user report at https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095/3
The text was updated successfully, but these errors were encountered: