# How to change vtkImageReslice background color

**URL:** https://discourse.vtk.org/t/how-to-change-vtkimagereslice-background-color/13410
**Category:** Support
**Tags:** code
**Created:** [February 29, 2024, 2:02am UTC](https://discourse.vtk.org/t/how-to-change-vtkimagereslice-background-color/13410 "2024-02-29T02:02:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![chu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/dfb087/32.png) [@chu](https://discourse.vtk.org/u/chu)
#### Post date: [February 29, 2024, 2:02am UTC](https://discourse.vtk.org/t/how-to-change-vtkimagereslice-background-color/13410/1 "2024-02-29T02:02:54Z")

</div>

Hello,

When I create a vtkImageReslice and rotate it using the SetResliceAxes function, I get a gray background.

Is there a way to change the gray background to black?

```
    imageReslice->SetBackgroundColor(0.0, 0.0, 0.0, 0.0);
    imageReslice->AutoCropOutputOn();
    imageReslice->SetOptimization(1);
    imageReslice->SetOutputDimensionality(2);	
    imageReslice->SetInterpolationModeToLinear();	

    imageReslice->SetResliceAxes(matrix);

```

 ![111](https://discourse.vtk.org/uploads/default/original/2X/7/78e118b5c4c9ec506462f1b1b360b2363b5d6f9b.jpeg)

---

<div class="post-metadata">

### Author: ![chu](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/dfb087/32.png) [@chu](https://discourse.vtk.org/u/chu)
#### Post date: [March 6, 2024, 3:48am UTC](https://discourse.vtk.org/t/how-to-change-vtkimagereslice-background-color/13410/2 "2024-03-06T03:48:20Z")

</div>

I solved it by referring to the link below.  
([Problem with ImageReslice](https://discourse.vtk.org/t/problem-with-imagereslice/9705))

SetBackgroundLevel(-1000.0);
