quantize

Stoner.Image.imagefuncs.quantize(im, output, levels=None)[source]

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

Parameters:

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.

Notes

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