pygfx.utils.enums.PixelFilter

pygfx.utils.enums.PixelFilter

The type of interpolation for flushing the result of a renderer to a target.

The filter is used both when upsampling and downsampling. The recommended (and default) is “mitchell”. Note that when the source and target image are of the same size, the filter is always nearest.

  • “nearest”: nearest-neighbour interpolation. Note that this introduces aliasing when downsampling.

  • “linear”: linear interpolation. Note that this introduces aliasing when downsampling.

  • “tent”: linearly combines samples based on their distance using a smaller kernel than the cubic filters. When upsampling, it does the same a ‘linear’.

  • “disk”: a circular filter shape to show individual pixels in upsampling cases.

  • “bspline”: cubic spline of the type b-spline, which is rather smooth but has no overshoot.

  • “mitchell”: cubic spline of the type Mitchel-Netravali, which is optimized for image interpolation.

  • “catmull”: cubic spline of the type Catmull-Rom, which is sharper, but has more ringing effects.

alias of Literal[‘nearest’, ‘linear’, ‘tent’, ‘disk’, ‘bspline’, ‘mitchell’, ‘catmull’]