# \[VTK 9.0.0rc3\] Python can't set multisamples

**URL:** https://discourse.vtk.org/t/vtk-9-0-0rc3-python-cant-set-multisamples/3223
**Category:** Support
**Created:** [May 6, 2020, 2:32am UTC](https://discourse.vtk.org/t/vtk-9-0-0rc3-python-cant-set-multisamples/3223 "2020-05-06T02:32:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jasonb5](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jasonb5/32/1734_2.png) [@jasonb5](https://discourse.vtk.org/u/jasonb5)
#### Post date: [May 6, 2020, 2:32am UTC](https://discourse.vtk.org/t/vtk-9-0-0rc3-python-cant-set-multisamples/3223/1 "2020-05-06T02:32:20Z")

</div>

Calling `SetMultiSamples` has no affect using VTK 9.0.0rc3. In both examples I would expect the output to show a difference in images but only the 8.2.0 environment produces these results. I’m unsure if i’m using this correctly or if this is a bug.

8.2.0 environment:

```bash
conda create -n vcs-mesa-18.3.1-8.2.0 -c conda-forge/label/vtk_dev -c conda-forge "vtk=8.2.0" "mesalib=18.3.1" pillow

```

9.0.0rc3 environment:

```bash
conda create -n vcs-mesa-18.3.1-9.0.0 -c conda-forge/label/vtk_dev -c conda-forge vtk "mesalib=18.3.1" pillow

```

Script:

```python
import vtk
from PIL import ImageChops
from PIL import Image

colors = vtk.vtkNamedColors()

def draw_line(aa=None):
    renderer = vtk.vtkRenderer()

    window = vtk.vtkRenderWindow()
    window.SetSize(640, 480)
    window.AddRenderer(renderer)

    source = vtk.vtkLineSource()
    source.SetPoint1([0.0, 0.0, 0.0])
    source.SetPoint2([640.0, 480.0, 0.0])

    mapper = vtk.vtkPolyDataMapper()
    mapper.SetInputConnection(source.GetOutputPort())

    actor = vtk.vtkActor()
    actor.GetProperty().SetLineWidth(1.0)
    actor.GetProperty().SetColor(colors.GetColor3d('Black'))
    actor.SetMapper(mapper)

    renderer.AddActor(actor)
    renderer.SetBackground(colors.GetColor3d('White'))

    if aa is not None:
        window.SetMultiSamples(aa)

    value = window.GetMultiSamples()

    window.Render()

    image = vtk.vtkWindowToImageFilter()
    image.SetInput(window)
    image.SetInputBufferTypeToRGB()
    image.ReadFrontBufferOff()
    image.Update()

    filename = f'vtk-{vtk.VTK_VERSION}_{value}.png'

    writer = vtk.vtkPNGWriter()
    writer.SetFileName(filename)
    writer.SetInputConnection(image.GetOutputPort())
    writer.Write()

    return filename

base = draw_line(0)
aa32 = draw_line(32)

img1 = Image.open(base)
img2 = Image.open(aa32)

diff = ImageChops.difference(img1, img2)

diff.save(f'vtk-{vtk.VTK_VERSION}-diff.png')

```
