mindspore.dataset.vision.Posterize

class mindspore.dataset.vision.Posterize(bits)[source]

Reduce the bit depth of the color channels of image to create a high contrast and vivid color effect, similar to that seen in posters or printed materials.

Parameters

bits (int) – The number of bits to keep for each channel, should be in range of [0, 8].

Raises
  • TypeError – If bits is not of type int.

  • ValueError – If bits is not in range [0, 8].

  • RuntimeError – If shape of the input image is not <H, W> or <H, W, C>.