manim icon indicating copy to clipboard operation
manim copied to clipboard

Gradient color looks ugly (not smooth enough)

Open olbapbetan opened this issue 3 years ago • 2 comments

Description of bug / unexpected behavior

When gradient color is applied to a big solid object it looks ugly, with some diagonal lines on it, like the change from a color to another is not smooth.

This is an example of what I am describing: Intro_ManimCE_v0 17 2

Expected behavior

The change from a color to another one should be smoother and not so notizable.

How to reproduce the issue

Code for reproducing the problem

I leave a minimal example code:

from manim import *

class Intro(Scene):
    def construct(self):
        self.add(Rectangle(WHITE, height=config.frame_height, width=config.frame_width).set_fill([BLUE, RED], 1))

The problem I previously described is not because of this code; other codes will produce the same result. I imagine the problem is related to OpenGL, by how it is used by Manim.

System specifications

System Details
  • Windows 10
  • Python version: 3.10.2

olbapbetan avatar Jan 10 '23 00:01 olbapbetan

A simple gradient like this will always have this issue (banding). Well explained here. The gradient could be made nicer by using dithering.

vaclavblazej avatar Aug 20 '23 20:08 vaclavblazej

This should probably be resolved when using OpenGL and in future versions we hopefully manage to make the move to OpenGL with the experimental version, so this will hopefully not be a problem anymore but we will keep track of it.

MrDiver avatar Dec 02 '23 13:12 MrDiver