# Grey Level Image looking Blue (or other color)

**URL:** <https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095>\
**Category:** Support\
**Tags:** visualization\
**Created:** [June 12, 2021, 8:11pm UTC](https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095 "2021-06-12T20:11:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MachadoL](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/machadol/32/3372_2.png) [@MachadoL](https://discourse.slicer.org/u/MachadoL)\
**Post date:** [June 12, 2021, 8:11pm UTC](https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095/1 "2021-06-12T20:11:29Z")

</div>

Hey guys recurrently I get into this situation. I have a gray scale medical image, but when I load the image inside 3D slicer… the image appears BLUE!  
Take a look. It is like this:

 ![WhatsApp Image 2021-06-11 at 17.49.48](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/6/a68d7a88c9e53fb4218a2dbf2153176d20f44f13.jpeg)

But appears like this:

 ![WhatsApp Image 2021-06-11 at 17.49.34](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/8/98cf839fe6636e9a5ed54744c0a9fe1bf4ff1b7e.jpeg)

Could’n find out why.  
Any help is welcomed.

Leo.

---

<div class="post-metadata">

**Author:** ![steffen-o](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/steffen-o/32/2660_2.png) [@steffen-o](https://discourse.slicer.org/u/steffen-o)\
**Post date:** [June 15, 2021, 10:44am UTC](https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095/2 "2021-06-15T10:44:56Z")

</div>

Did you change the color lookup table in the --\>Volumes Module --\>Display --\>Lookup table  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/0/d05926b81bb7460878f451352e1b98673f7717f2.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 15, 2021, 5:16pm UTC](https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095/3 "2021-06-15T17:16:43Z")

</div>

I guess it is a secondary capture, stored as a color image. Older ITK versions did not always read color channels correctly, but current version should work well. Does the image appear correctly if you use the latest Slicer Preview Release?

---

<div class="post-metadata">

**Author:** ![MachadoL](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/machadol/32/3372_2.png) [@MachadoL](https://discourse.slicer.org/u/MachadoL)\
**Post date:** [June 15, 2021, 7:08pm UTC](https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095/4 "2021-06-15T19:08:53Z")

</div>

@lassoan, @steffen-o,  
I just got it. The original file is **BPM** … once converted to **jpg or png…** , it appears in GREY as it should.

If you have any practical way to do that without needing any other secondary software, but inside 3D Slicer, that would be great.

Thanks, Leo.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 15, 2021, 9:13pm UTC](https://discourse.slicer.org/t/grey-level-image-looking-blue-or-other-color/18095/5 "2021-06-15T21:13:09Z")

</div>

It seems that ITK’s BMP reader still mixes up the channels if you use transparency. You can fix the order using this code snippet:

```python
volumeNode=slicer.util.loadVolume(r'c:\Users\andra\OneDrive\15-14-49.bmp')
a=slicer.util.arrayFromVolume(volumeNode)
a[:]=a[:,:,:,[1,2,3,0]] # reorder color channels
slicer.util.arrayFromVolumeModified(volumeNode)

```

BMP is a very old file format that and transparency was never widely used or supported by applications. I would recommend to switch to the much more widely used png file format. I’ve submitted a bug report to ITK, but I will not be surprised if they don’t fix a very rarely used feature of an ancient file format.

> <https://github.com/InsightSoftwareConsortium/ITK/issues/2596>
>
> 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
> 
> \`\`\`python
> img = sitk.ReadImage('15-14-49.bmp')
> myshow(img) # incorrect
> \`\`\`
> 
> \`\`\`python
> nda = sitk.GetArrayFromImage(img)
> img2=sitk.GetImageFromArray(nda\[:,:,\[1,2,3,0\]\])
> myshow(img2) # correct
> \`\`\`
> 
> !\[image\](https://user-images.githubusercontent.com/307929/122123570-228c3a00-cdfc-11eb-80a6-4e536fb78faa.png)
> 
> \### 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
