pygfx.materials.ImageBasicMaterial

class pygfx.materials.ImageBasicMaterial(maprange=None, clim=None, map=None, gamma=1.0, interpolation='nearest', **kwargs)

Bases: Material

Rasterized image material.

Parameters:
  • maprange (tuple) – The range of the geometry.texcoords that is projected onto the (color) map. Default (0, 1).

  • clim (tuple) – The contrast limits. Alias for maprange.

  • map (TextureMap | Texture) – The texture map to turn the image values into its final color. Optional.

  • gamma (float) – The gamma correction to apply to the image data. Default 1.

  • interpolation (str) – The method to interpolate the image data. Either ‘nearest’ or ‘linear’. Default ‘nearest’.

  • kwargs (Any) – Additional kwargs will be passed to the material base class.

property map

The texture map to turn the image values into its final color. If None, the values themselves represents the color. The dimensionality of the texture map can be 1D, 2D or 3D, but should match the number of channels in the image.

Note: for scientific data, it is usually to set wrap mode to ‘clamp’.

property maprange

The range of the geometry.texcoords that is projected onto the (color) map.

By default this value is (0.0, 1.0), but if the texcoords represents some domain-specific value, e.g. temperature, then maprange can be set to e.g. (0, 100).

property clim

Alias for maprange; for images, clim (contrast limits) is a common term.

property gamma

The gamma correction to apply to the image data. Default 1.

property interpolation

The method to interpolate the image data. Either ‘nearest’ or ‘linear’.