# Change the background color black to white? in red, yellow and green slices?

**URL:** https://discourse.slicer.org/t/change-the-background-color-black-to-white-in-red-yellow-and-green-slices/17715
**Category:** Support
**Created:** [May 20, 2021, 7:17pm UTC](https://discourse.slicer.org/t/change-the-background-color-black-to-white-in-red-yellow-and-green-slices/17715 "2021-05-20T19:17:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)
#### Post date: [May 20, 2021, 7:17pm UTC](https://discourse.slicer.org/t/change-the-background-color-black-to-white-in-red-yellow-and-green-slices/17715/1 "2021-05-20T19:17:29Z")

</div>

Would it be possible to somehow change the background color to white rather than having it black?

Thanks…

---

<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: [May 21, 2021, 5:50pm UTC](https://discourse.slicer.org/t/change-the-background-color-black-to-white-in-red-yellow-and-green-slices/17715/2 "2021-05-21T17:50:44Z")

</div>

There is no GUI for changing the slice view background color, but you can do it by copy-pasting [these few lines](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#capture-slice-view-into-png-file-with-white-background) into the Python console.

---

<div class="post-metadata">

### Author: ![hmaguilera](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@hmaguilera](https://discourse.slicer.org/u/hmaguilera)
#### Post date: [November 18, 2021, 9:28am UTC](https://discourse.slicer.org/t/change-the-background-color-black-to-white-in-red-yellow-and-green-slices/17715/3 "2021-11-18T09:28:32Z")

</div>

Hi Andras,  
I want to change the background of 3D view to white, so I can get figures with white backgrounds.

I tried copy-pasting the lines, but did not manage to do this for the 3D view. And the " Capture 3D view into PNG file with transparent background" did not do anything other than taking a screenshot.

Thanks

---

<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: [November 18, 2021, 3:00pm UTC](https://discourse.slicer.org/t/change-the-background-color-black-to-white-in-red-yellow-and-green-slices/17715/4 "2021-11-18T15:00:16Z")

</div>

You can use the GUI to change the 3D view background:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/b/fb05f9a4f4248f2e4d6b76f5cf7f961f3b12522d.png)

If you set the background to black then the [code snippet for capturing of 3D view with transparent background](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#capture-3d-view-into-png-file-with-transparent-background) will work correctly.

---

<div class="post-metadata">

### Author: ![hmaguilera](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@hmaguilera](https://discourse.slicer.org/u/hmaguilera)
#### Post date: [November 18, 2021, 3:47pm UTC](https://discourse.slicer.org/t/change-the-background-color-black-to-white-in-red-yellow-and-green-slices/17715/5 "2021-11-18T15:47:17Z")

</div>

Thank you very much!
