mayavi icon indicating copy to clipboard operation
mayavi copied to clipboard

antialiased not working for mlab.screenshot

Open JackRBlack opened this issue 6 years ago • 2 comments

I'm using Mayavi in Jupiter notebook on macOS, and just found that, when using the screenshot function, the results are the same whether the antialiased option is on or not:

# draw something with Mayavi
mlab.figure(size=(500, 500))
obj = mlab.test_plot3d()

# call screenshot
a = mlab.screenshot(figure = obj, mode = 'rgba', antialiased=True)
b = mlab.screenshot(figure = obj, mode = 'rgba', antialiased=False)

# check if they are the same
np.max(a - b)

And this returns

0

which means they are exactly the same. Why is the antialiased option not working?

I searched the Mayavi documentations, and found this

obj.scene.anti_aliasing_frames = 8

I have tried to change this value, but nothing happened.

By the way, the rendering is pretty good in "x3d backend":

image

But using screenshot, the result is really a mess:

image

How to solve this problem?

JackRBlack avatar Dec 02 '19 09:12 JackRBlack

I'm having this same problem. @JackRBlack did you find any fix/workaround for this?

lopsided avatar Aug 04 '22 08:08 lopsided

I think I used matplotlib for antialiasing after acquiring the low-quality screenshot image. I'm not sure if this problem is fixed now because I haven't used mayavi since then.

JackRBlack avatar Aug 05 '22 09:08 JackRBlack