# Prevent Renderer from Smoothing Image - Prefer to See Pixelated

**URL:** https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075
**Category:** Support
**Created:** [November 8, 2019, 2:40pm UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075 "2019-11-08T14:40:23Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![MichelleKline](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michellekline/32/2155_2.png) [@MichelleKline](https://discourse.vtk.org/u/MichelleKline)
#### Post date: [November 8, 2019, 2:40pm UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075/1 "2019-11-08T14:40:24Z")

</div>

Hello,

I am displaying images in a vtkRenderWindow using vtkImageSlice (with a vtkImageResliceToColors mapper), a vtkImageStack, and a vtkRenderer.  
When the images render, they appear “smoothed”. If I zoom in on an individual pixel, it may display a gradient of colors. I want to be able to distinguish each individual pixel, and I want each individual pixel to map to only one color. What setting or settings do I need to use?

 ![onePixelSmooth](https://discourse.vtk.org/uploads/default/original/2X/4/4f43a0d1b096fe371a6803c6c150303ad6d5a35a.png)

Thank you,  
Michelle Kline

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [November 8, 2019, 3:25pm UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075/2 "2019-11-08T15:25:09Z")

</div>

You should be able to change interpolation type to nearest neighbor.

---

<div class="post-metadata">

### Author: ![MichelleKline](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michellekline/32/2155_2.png) [@MichelleKline](https://discourse.vtk.org/u/MichelleKline)
#### Post date: [November 8, 2019, 3:27pm UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075/3 "2019-11-08T15:27:00Z")

</div>

Thanks, Andras, but where is the interpolation type property? Is it a property of vtkRenderer? vtkRenderWindow? Other?

- Michelle

---

<div class="post-metadata">

### Author: ![MichelleKline](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michellekline/32/2155_2.png) [@MichelleKline](https://discourse.vtk.org/u/MichelleKline)
#### Post date: [November 8, 2019, 3:44pm UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075/4 "2019-11-08T15:44:14Z")

</div>

OH! I should have mentioned that I am initially passing the image through vtkImageReslice! Maybe that is why? But if it is vtkImageReslice that is doing the smoothing, then why does an image obtained by vktImageReslice.GetOutput() have smoothing, even if I have set the resliceAxes to be the identity matrix?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [November 8, 2019, 3:50pm UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075/5 "2019-11-08T15:50:07Z")

</div>

Check _all_ the classes that you use if they have interpolation options. You should be familiar with your pipeline and know what each component does anyway.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [November 8, 2019, 4:50pm UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075/6 "2019-11-08T16:50:22Z")

</div>

Hi Michelle, if you have a vtkImageSlice object you can turn off the smoothing like so:

```
imageSlice.GetProperty().SetInterpolationTypeToNearest()
```

---

<div class="post-metadata">

### Author: ![MichelleKline](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michellekline/32/2155_2.png) [@MichelleKline](https://discourse.vtk.org/u/MichelleKline)
#### Post date: [November 9, 2019, 8:26am UTC](https://discourse.vtk.org/t/prevent-renderer-from-smoothing-image-prefer-to-see-pixelated/2075/7 "2019-11-09T08:26:37Z")

</div>

Thanks, David. That did the trick.
