ImageFile.quantize(output, levels=None)

Quantise the image data into fixed levels given by a mapping.


output (list,array,tuple) – Output levels to return.

Keyword Arguments

levels (list, array or None) – The input band markers. If None is constructed from the data.

The number of levels should be one less than the number of output levels given.


The routine will ignore all masked pixels and will preserve the mask.